	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw5864_request_encoded_frame   ## -- Begin function tw5864_request_encoded_frame
	.p2align	4, 0x90
_tw5864_request_encoded_frame:          ## @tw5864_request_encoded_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	_TW5864_DSP_CODEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TW5864_CIF_MAP_MD@GOTPCREL(%rip), %rax
	movq	_TW5864_HD1_MAP_MD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_tw_setl
	movq	_TW5864_EMU@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r15), %esi
	callq	_tw_writel
	movq	_TW5864_INTERLACING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%r15), %esi
	callq	_tw_writel
	movq	_TW5864_DSP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r15), %esi
	callq	_tw_writel
	movq	_TW5864_DSP_QP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	12(%r15), %esi
	callq	_tw_writel
	movq	_TW5864_DSP_REF_MVP_LAMBDA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	16(%r15), %esi
	callq	_tw_writel
	movq	_TW5864_DSP_I4x4_WEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%r15), %esi
	callq	_tw_writel
	movq	_TW5864_DSP_INTRA_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TW5864_DSP_INTRA_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TW5864_DSP_INTRA_MODE_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_TW5864_DSP_INTRA_MODE_16x16@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_tw_mask_shift_writel
	cmpq	$0, 24(%r15)
	movq	_TW5864_MOTION_SEARCH_ETC@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_TW5864_INTRA_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	je	LBB0_1
## %bb.2:
	movq	_TW5864_ME_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	$5, %edi
	callq	_BIT
	orl	%eax, %ebx
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_tw_writel
	jmp	LBB0_3
LBB0_1:
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_tw_writel
	movl	40(%r15), %eax
	incl	%eax
	movq	_TW5864_DSP_REF_FRM@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movl	%eax, 40(%r15)
LBB0_3:
	movq	%r15, %rdi
	callq	_tw5864_prepare_frame_headers
	movq	_TW5864_VLC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TW5864_VLC_PCI_SEL@GOTPCREL(%rip), %rax
	movl	32(%r15), %esi
	addl	$24, %esi
	movq	_TW5864_VLC_BIT_ALIGN_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	(%rax), %esi
	orl	12(%r15), %esi
	callq	_tw_writel
	movq	_TW5864_ENC_BUF_PTR_REC1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	36(%r15), %edx
	addl	%edx, %edx
	movl	$3, %esi
	callq	_tw_mask_shift_readl
	movl	%eax, %ebx
	movq	_TW5864_DSP_ENC_ORG_PTR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TW5864_DSP_ENC_ORG_PTR_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	%ebx, %esi
	shll	%cl, %esi
	callq	_tw_writel
	movq	_TW5864_DSP_ENC_REC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %eax
	shll	$12, %eax
	decl	%ebx
	andl	$3, %ebx
	orl	%eax, %ebx
	movl	%ebx, %esi
	callq	_tw_writel
	movq	_TW5864_SLICE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_TW5864_START_NSLICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_tw_writel
	movl	(%rbx), %edi
	xorl	%esi, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_tw_writel                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TW5864_DSP_CODEC,4,2           ## @TW5864_DSP_CODEC
	.comm	_TW5864_CIF_MAP_MD,4,2          ## @TW5864_CIF_MAP_MD
	.comm	_TW5864_HD1_MAP_MD,4,2          ## @TW5864_HD1_MAP_MD
	.comm	_TW5864_EMU,4,2                 ## @TW5864_EMU
	.comm	_TW5864_INTERLACING,4,2         ## @TW5864_INTERLACING
	.comm	_TW5864_DSP,4,2                 ## @TW5864_DSP
	.comm	_TW5864_DSP_QP,4,2              ## @TW5864_DSP_QP
	.comm	_TW5864_DSP_REF_MVP_LAMBDA,4,2  ## @TW5864_DSP_REF_MVP_LAMBDA
	.comm	_TW5864_DSP_I4x4_WEIGHT,4,2     ## @TW5864_DSP_I4x4_WEIGHT
	.comm	_TW5864_DSP_INTRA_MODE,4,2      ## @TW5864_DSP_INTRA_MODE
	.comm	_TW5864_DSP_INTRA_MODE_MASK,4,2 ## @TW5864_DSP_INTRA_MODE_MASK
	.comm	_TW5864_DSP_INTRA_MODE_SHIFT,4,2 ## @TW5864_DSP_INTRA_MODE_SHIFT
	.comm	_TW5864_DSP_INTRA_MODE_16x16,4,2 ## @TW5864_DSP_INTRA_MODE_16x16
	.comm	_TW5864_MOTION_SEARCH_ETC,4,2   ## @TW5864_MOTION_SEARCH_ETC
	.comm	_TW5864_INTRA_EN,4,2            ## @TW5864_INTRA_EN
	.comm	_TW5864_DSP_REF_FRM,4,2         ## @TW5864_DSP_REF_FRM
	.comm	_TW5864_ME_EN,4,2               ## @TW5864_ME_EN
	.comm	_TW5864_VLC,4,2                 ## @TW5864_VLC
	.comm	_TW5864_VLC_PCI_SEL,4,2         ## @TW5864_VLC_PCI_SEL
	.comm	_TW5864_VLC_BIT_ALIGN_SHIFT,4,2 ## @TW5864_VLC_BIT_ALIGN_SHIFT
	.comm	_TW5864_ENC_BUF_PTR_REC1,4,2    ## @TW5864_ENC_BUF_PTR_REC1
	.comm	_TW5864_DSP_ENC_ORG_PTR_REG,4,2 ## @TW5864_DSP_ENC_ORG_PTR_REG
	.comm	_TW5864_DSP_ENC_ORG_PTR_SHIFT,4,2 ## @TW5864_DSP_ENC_ORG_PTR_SHIFT
	.comm	_TW5864_DSP_ENC_REC,4,2         ## @TW5864_DSP_ENC_REC
	.comm	_TW5864_SLICE,4,2               ## @TW5864_SLICE
	.comm	_TW5864_START_NSLICE,4,2        ## @TW5864_START_NSLICE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tw5864_request_encoded_frame   ; -- Begin function tw5864_request_encoded_frame
	.p2align	2
_tw5864_request_encoded_frame:          ; @tw5864_request_encoded_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, x0
Lloh0:
	adrp	x8, _TW5864_DSP_CODEC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TW5864_DSP_CODEC@GOTPAGEOFF]
Lloh2:
	adrp	x9, _TW5864_CIF_MAP_MD@GOTPAGE
Lloh3:
	ldr	x9, [x9, _TW5864_CIF_MAP_MD@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	ldr	w8, [x9]
Lloh6:
	adrp	x9, _TW5864_HD1_MAP_MD@GOTPAGE
Lloh7:
	ldr	x9, [x9, _TW5864_HD1_MAP_MD@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_tw_setl
Lloh9:
	adrp	x8, _TW5864_EMU@GOTPAGE
Lloh10:
	ldr	x8, [x8, _TW5864_EMU@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	ldr	w1, [x19]
	bl	_tw_writel
Lloh12:
	adrp	x8, _TW5864_INTERLACING@GOTPAGE
Lloh13:
	ldr	x8, [x8, _TW5864_INTERLACING@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	ldr	w1, [x19, #4]
	bl	_tw_writel
Lloh15:
	adrp	x8, _TW5864_DSP@GOTPAGE
Lloh16:
	ldr	x8, [x8, _TW5864_DSP@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
	ldr	w1, [x19, #8]
	bl	_tw_writel
Lloh18:
	adrp	x8, _TW5864_DSP_QP@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TW5864_DSP_QP@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	w1, [x19, #12]
	bl	_tw_writel
Lloh21:
	adrp	x8, _TW5864_DSP_REF_MVP_LAMBDA@GOTPAGE
Lloh22:
	ldr	x8, [x8, _TW5864_DSP_REF_MVP_LAMBDA@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	w1, [x19, #16]
	bl	_tw_writel
Lloh24:
	adrp	x8, _TW5864_DSP_I4x4_WEIGHT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _TW5864_DSP_I4x4_WEIGHT@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	w1, [x19, #20]
	bl	_tw_writel
Lloh27:
	adrp	x8, _TW5864_DSP_INTRA_MODE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _TW5864_DSP_INTRA_MODE@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
Lloh30:
	adrp	x8, _TW5864_DSP_INTRA_MODE_MASK@GOTPAGE
Lloh31:
	ldr	x8, [x8, _TW5864_DSP_INTRA_MODE_MASK@GOTPAGEOFF]
Lloh32:
	ldr	w1, [x8]
Lloh33:
	adrp	x8, _TW5864_DSP_INTRA_MODE_SHIFT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _TW5864_DSP_INTRA_MODE_SHIFT@GOTPAGEOFF]
Lloh35:
	ldr	w2, [x8]
Lloh36:
	adrp	x8, _TW5864_DSP_INTRA_MODE_16x16@GOTPAGE
Lloh37:
	ldr	x8, [x8, _TW5864_DSP_INTRA_MODE_16x16@GOTPAGEOFF]
Lloh38:
	ldr	w3, [x8]
	bl	_tw_mask_shift_writel
	ldr	x8, [x19, #24]
Lloh39:
	adrp	x9, _TW5864_MOTION_SEARCH_ETC@GOTPAGE
Lloh40:
	ldr	x9, [x9, _TW5864_MOTION_SEARCH_ETC@GOTPAGEOFF]
Lloh41:
	ldr	w20, [x9]
Lloh42:
	adrp	x9, _TW5864_INTRA_EN@GOTPAGE
Lloh43:
	ldr	x9, [x9, _TW5864_INTRA_EN@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x9]
	cbz	x8, LBB0_2
; %bb.1:
Lloh45:
	adrp	x8, _TW5864_ME_EN@GOTPAGE
Lloh46:
	ldr	x8, [x8, _TW5864_ME_EN@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	orr	w21, w8, w1
	mov	w0, #5
	bl	_BIT
	orr	w1, w21, w0
	mov	x0, x20
	bl	_tw_writel
	b	LBB0_3
LBB0_2:
	mov	x0, x20
	bl	_tw_writel
	ldr	w8, [x19, #40]
	add	w8, w8, #1
Lloh48:
	adrp	x9, _TW5864_DSP_REF_FRM@GOTPAGE
Lloh49:
	ldr	x9, [x9, _TW5864_DSP_REF_FRM@GOTPAGEOFF]
Lloh50:
	ldr	w9, [x9]
	and	w8, w9, w8
	str	w8, [x19, #40]
LBB0_3:
	mov	x0, x19
	bl	_tw5864_prepare_frame_headers
Lloh51:
	adrp	x8, _TW5864_VLC@GOTPAGE
Lloh52:
	ldr	x8, [x8, _TW5864_VLC@GOTPAGEOFF]
Lloh53:
	ldr	w0, [x8]
Lloh54:
	adrp	x8, _TW5864_VLC_PCI_SEL@GOTPAGE
Lloh55:
	ldr	x8, [x8, _TW5864_VLC_PCI_SEL@GOTPAGEOFF]
Lloh56:
	ldr	w8, [x8]
	ldr	w9, [x19, #32]
Lloh57:
	adrp	x10, _TW5864_VLC_BIT_ALIGN_SHIFT@GOTPAGE
Lloh58:
	ldr	x10, [x10, _TW5864_VLC_BIT_ALIGN_SHIFT@GOTPAGEOFF]
	add	w9, w9, #24
Lloh59:
	ldr	w10, [x10]
	lsl	w9, w9, w10
	orr	w8, w9, w8
	ldr	w9, [x19, #12]
	orr	w1, w8, w9
	bl	_tw_writel
Lloh60:
	adrp	x8, _TW5864_ENC_BUF_PTR_REC1@GOTPAGE
Lloh61:
	ldr	x8, [x8, _TW5864_ENC_BUF_PTR_REC1@GOTPAGEOFF]
Lloh62:
	ldr	w0, [x8]
	ldr	w8, [x19, #36]
	lsl	w2, w8, #1
	mov	w1, #3
	bl	_tw_mask_shift_readl
	mov	x19, x0
Lloh63:
	adrp	x8, _TW5864_DSP_ENC_ORG_PTR_REG@GOTPAGE
Lloh64:
	ldr	x8, [x8, _TW5864_DSP_ENC_ORG_PTR_REG@GOTPAGEOFF]
Lloh65:
	ldr	w0, [x8]
Lloh66:
	adrp	x8, _TW5864_DSP_ENC_ORG_PTR_SHIFT@GOTPAGE
Lloh67:
	ldr	x8, [x8, _TW5864_DSP_ENC_ORG_PTR_SHIFT@GOTPAGEOFF]
Lloh68:
	ldr	w8, [x8]
	lsl	w1, w19, w8
	bl	_tw_writel
Lloh69:
	adrp	x8, _TW5864_DSP_ENC_REC@GOTPAGE
Lloh70:
	ldr	x8, [x8, _TW5864_DSP_ENC_REC@GOTPAGEOFF]
Lloh71:
	ldr	w0, [x8]
	sub	w8, w19, #1
	and	w1, w8, #0x3
	bfi	w1, w19, #12, #20
	bl	_tw_writel
Lloh72:
	adrp	x19, _TW5864_SLICE@GOTPAGE
Lloh73:
	ldr	x19, [x19, _TW5864_SLICE@GOTPAGEOFF]
	ldr	w0, [x19]
Lloh74:
	adrp	x8, _TW5864_START_NSLICE@GOTPAGE
Lloh75:
	ldr	x8, [x8, _TW5864_START_NSLICE@GOTPAGEOFF]
Lloh76:
	ldr	w1, [x8]
	bl	_tw_writel
	ldr	w0, [x19]
	mov	w1, #0
	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
	b	_tw_writel
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpLdrGot	Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh69, Lloh70, Lloh71
	.loh AdrpLdrGotLdr	Lloh66, Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.cfi_endproc
                                        ; -- End function
	.comm	_TW5864_DSP_CODEC,4,2           ; @TW5864_DSP_CODEC
	.comm	_TW5864_CIF_MAP_MD,4,2          ; @TW5864_CIF_MAP_MD
	.comm	_TW5864_HD1_MAP_MD,4,2          ; @TW5864_HD1_MAP_MD
	.comm	_TW5864_EMU,4,2                 ; @TW5864_EMU
	.comm	_TW5864_INTERLACING,4,2         ; @TW5864_INTERLACING
	.comm	_TW5864_DSP,4,2                 ; @TW5864_DSP
	.comm	_TW5864_DSP_QP,4,2              ; @TW5864_DSP_QP
	.comm	_TW5864_DSP_REF_MVP_LAMBDA,4,2  ; @TW5864_DSP_REF_MVP_LAMBDA
	.comm	_TW5864_DSP_I4x4_WEIGHT,4,2     ; @TW5864_DSP_I4x4_WEIGHT
	.comm	_TW5864_DSP_INTRA_MODE,4,2      ; @TW5864_DSP_INTRA_MODE
	.comm	_TW5864_DSP_INTRA_MODE_MASK,4,2 ; @TW5864_DSP_INTRA_MODE_MASK
	.comm	_TW5864_DSP_INTRA_MODE_SHIFT,4,2 ; @TW5864_DSP_INTRA_MODE_SHIFT
	.comm	_TW5864_DSP_INTRA_MODE_16x16,4,2 ; @TW5864_DSP_INTRA_MODE_16x16
	.comm	_TW5864_MOTION_SEARCH_ETC,4,2   ; @TW5864_MOTION_SEARCH_ETC
	.comm	_TW5864_INTRA_EN,4,2            ; @TW5864_INTRA_EN
	.comm	_TW5864_DSP_REF_FRM,4,2         ; @TW5864_DSP_REF_FRM
	.comm	_TW5864_ME_EN,4,2               ; @TW5864_ME_EN
	.comm	_TW5864_VLC,4,2                 ; @TW5864_VLC
	.comm	_TW5864_VLC_PCI_SEL,4,2         ; @TW5864_VLC_PCI_SEL
	.comm	_TW5864_VLC_BIT_ALIGN_SHIFT,4,2 ; @TW5864_VLC_BIT_ALIGN_SHIFT
	.comm	_TW5864_ENC_BUF_PTR_REC1,4,2    ; @TW5864_ENC_BUF_PTR_REC1
	.comm	_TW5864_DSP_ENC_ORG_PTR_REG,4,2 ; @TW5864_DSP_ENC_ORG_PTR_REG
	.comm	_TW5864_DSP_ENC_ORG_PTR_SHIFT,4,2 ; @TW5864_DSP_ENC_ORG_PTR_SHIFT
	.comm	_TW5864_DSP_ENC_REC,4,2         ; @TW5864_DSP_ENC_REC
	.comm	_TW5864_SLICE,4,2               ; @TW5864_SLICE
	.comm	_TW5864_START_NSLICE,4,2        ; @TW5864_START_NSLICE
.subsections_via_symbols
