	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function xavs2_encode_frame
_xavs2_encode_frame:                    ## @xavs2_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rdi), %rbx
	movq	40(%rbx), %rax
	movl	32(%rbx), %edi
	leaq	-64(%rbp), %rsi
	callq	*(%rax)
	testq	%rax, %rax
	js	LBB0_1
## %bb.3:
	testq	%r13, %r13
	je	LBB0_14
## %bb.4:
	movl	(%r13), %eax
	cmpl	$128, %eax
	je	LBB0_8
## %bb.5:
	cmpl	$129, %eax
	jne	LBB0_9
## %bb.6:
	movl	-44(%rbp), %eax
	cmpl	-48(%rbp), %eax
	je	LBB0_7
## %bb.11:
	movq	40(%rbx), %rax
	movl	48(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	*24(%rax)
	movl	%eax, %edi
	callq	_atoi
	leaq	-64(%rbp), %rdi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_xavs2_copy_frame_with_shift
	jmp	LBB0_12
LBB0_1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	jmp	LBB0_2
LBB0_14:
	movq	40(%rbx), %rax
	movl	32(%rbx), %edi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	*8(%rax)
	jmp	LBB0_15
LBB0_8:
	movl	-44(%rbp), %eax
	cmpl	-48(%rbp), %eax
	jne	LBB0_9
LBB0_7:
	leaq	-64(%rbp), %rdi
	movq	%r13, %rsi
	callq	_xavs2_copy_frame
LBB0_12:
	movq	$0, -56(%rbp)
	movl	4(%r13), %eax
	movl	%eax, -60(%rbp)
	movq	_XAVS2_TYPE_AUTO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	40(%rbx), %rax
	movl	32(%rbx), %edi
	leaq	-64(%rbp), %rsi
	movq	%rbx, %rdx
	callq	*8(%rax)
	testl	%eax, %eax
	je	LBB0_15
## %bb.13:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdx
LBB0_2:
	movq	%r15, %rdi
	callq	_av_log
	movq	_AVERROR_EXTERNAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_21
LBB0_15:
	movq	8(%rbx), %rsi
	xorl	%r13d, %r13d
	movl	$0, %eax
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.16:
	movq	(%rbx), %rcx
	movq	_XAVS2_STATE_FLUSH_END@GOTPCREL(%rip), %rdx
	movl	$0, %eax
	cmpq	(%rdx), %rcx
	je	LBB0_20
## %bb.17:
	movq	%r12, %rdi
	callq	_av_new_packet
	testq	%rax, %rax
	js	LBB0_18
## %bb.19:
	movl	24(%rbx), %eax
	movl	%eax, 16(%r12)
	movl	20(%rbx), %eax
	movl	%eax, 12(%r12)
	movl	8(%r12), %edi
	movl	16(%rbx), %esi
	movq	8(%rbx), %rdx
	callq	_memcpy
	movq	8(%rbx), %rax
	movq	%rax, (%r12)
	movq	40(%rbx), %rax
	movl	32(%rbx), %edi
	movq	%rbx, %rsi
	callq	*16(%rax)
	movl	$1, %eax
LBB0_20:
	movl	%eax, (%r14)
	jmp	LBB0_21
LBB0_9:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdx
	movq	%r15, %rdi
	callq	_av_log
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %r13d
LBB0_21:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%r15, %rdi
	callq	_av_log
	movq	40(%rbx), %rax
	movl	32(%rbx), %edi
	movq	%rbx, %rsi
	callq	*16(%rax)
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to get frame buffer\n"

	.comm	_AVERROR_EXTERNAL,4,2           ## @AVERROR_EXTERNAL
L_.str.1:                               ## @.str.1
	.asciz	"SampleShift"

L_.str.2:                               ## @.str.2
	.asciz	"Unsupported pixel format\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_XAVS2_TYPE_AUTO,4,2            ## @XAVS2_TYPE_AUTO
L_.str.3:                               ## @.str.3
	.asciz	"encode failed\n"

	.comm	_XAVS2_STATE_FLUSH_END,8,3      ## @XAVS2_STATE_FLUSH_END
L_.str.4:                               ## @.str.4
	.asciz	"packet alloc failed\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_xavs2_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function xavs2_encode_frame
_xavs2_encode_frame:                    ; @xavs2_encode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x3
	mov	x23, x2
	mov	x22, x1
	mov	x21, x0
	ldr	x20, [x0]
	ldr	x8, [x20, #40]
	ldr	x8, [x8]
	ldr	w0, [x20, #32]
	add	x1, sp, #8
	blr	x8
	tbnz	x0, #63, LBB0_6
; %bb.1:
	cbz	x23, LBB0_7
; %bb.2:
	ldr	w8, [x23]
	cmp	w8, #128
	b.eq	LBB0_8
; %bb.3:
	cmp	w8, #129
	b.ne	LBB0_16
; %bb.4:
	ldp	w9, w8, [sp, #24]
	cmp	w8, w9
	b.eq	LBB0_9
; %bb.5:
	ldr	x8, [x20, #40]
	ldr	x8, [x8, #24]
	ldr	w0, [x20, #48]
Lloh0:
	adrp	x1, l_.str.1@PAGE
Lloh1:
	add	x1, x1, l_.str.1@PAGEOFF
	blr	x8
	bl	_atoi
	mov	x2, x0
	add	x0, sp, #8
	mov	x1, x23
	bl	_xavs2_copy_frame_with_shift
	b	LBB0_10
LBB0_6:
Lloh2:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_12
LBB0_7:
	ldr	x8, [x20, #40]
	ldr	x8, [x8, #8]
	ldr	w0, [x20, #32]
	mov	x1, #0
	mov	x2, x20
	blr	x8
	b	LBB0_13
LBB0_8:
	ldp	w9, w8, [sp, #24]
	cmp	w8, w9
	b.ne	LBB0_16
LBB0_9:
	add	x0, sp, #8
	mov	x1, x23
	bl	_xavs2_copy_frame
LBB0_10:
	str	xzr, [sp, #16]
	ldr	w8, [x23, #4]
Lloh7:
	adrp	x9, _XAVS2_TYPE_AUTO@GOTPAGE
Lloh8:
	ldr	x9, [x9, _XAVS2_TYPE_AUTO@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #8]
	ldr	x8, [x20, #40]
	ldr	x8, [x8, #8]
	ldr	w0, [x20, #32]
	add	x1, sp, #8
	mov	x2, x20
	blr	x8
	cbz	w0, LBB0_13
; %bb.11:
Lloh10:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str.3@PAGE
Lloh14:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_12:
	mov	x0, x21
	bl	_av_log
Lloh15:
	adrp	x8, _AVERROR_EXTERNAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AVERROR_EXTERNAL@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	b	LBB0_21
LBB0_13:
	ldr	x1, [x20, #8]
	cbz	x1, LBB0_15
; %bb.14:
	ldr	x8, [x20]
Lloh18:
	adrp	x9, _XAVS2_STATE_FLUSH_END@GOTPAGE
Lloh19:
	ldr	x9, [x9, _XAVS2_STATE_FLUSH_END@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
LBB0_15:
	mov	w8, #0
	b	LBB0_20
LBB0_16:
Lloh21:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh22:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x2, l_.str.2@PAGE
Lloh25:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_av_log
Lloh26:
	adrp	x8, _EINVAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_17:
	ldr	w0, [x8]
	bl	_AVERROR
	b	LBB0_21
LBB0_18:
	mov	x0, x22
	bl	_av_new_packet
	tbnz	x0, #63, LBB0_22
; %bb.19:
	ldur	d0, [x20, #20]
	stur	d0, [x22, #12]
	ldr	w0, [x22, #8]
	ldr	w1, [x20, #16]
	ldr	x2, [x20, #8]
	bl	_memcpy
	ldr	x8, [x20, #8]
	str	x8, [x22]
	ldr	x8, [x20, #40]
	ldr	x8, [x8, #16]
	ldr	w0, [x20, #32]
	mov	x1, x20
	blr	x8
	mov	w8, #1
LBB0_20:
	mov	w0, #0
	str	w8, [x19]
LBB0_21:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_22:
Lloh28:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
Lloh31:
	adrp	x2, l_.str.4@PAGE
Lloh32:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_av_log
	ldr	x8, [x20, #40]
	ldr	x8, [x8, #16]
	ldr	w0, [x20, #32]
	mov	x1, x20
	blr	x8
Lloh33:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh34:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_17
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh31, Lloh32
	.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	"failed to get frame buffer\n"

	.comm	_AVERROR_EXTERNAL,4,2           ; @AVERROR_EXTERNAL
l_.str.1:                               ; @.str.1
	.asciz	"SampleShift"

l_.str.2:                               ; @.str.2
	.asciz	"Unsupported pixel format\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_XAVS2_TYPE_AUTO,4,2            ; @XAVS2_TYPE_AUTO
l_.str.3:                               ; @.str.3
	.asciz	"encode failed\n"

	.comm	_XAVS2_STATE_FLUSH_END,8,3      ; @XAVS2_STATE_FLUSH_END
l_.str.4:                               ; @.str.4
	.asciz	"packet alloc failed\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_xavs2_encode_frame
.subsections_via_symbols
