	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function zx_tvenc_encoder_mode_set
_zx_tvenc_encoder_mode_set:             ## @zx_tvenc_encoder_mode_set
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_to_zx_tvenc
	movq	%rax, %r14
	movq	_VOU_DIV_INF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movq	_VOU_DIV_4@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)
	movq	_VOU_DIV_TVENC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_VOU_DIV_1@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_VOU_DIV_LAYER@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_VOU_DIV_2@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movl	(%rbx), %ebx
	leaq	-64(%rbp), %r12
	movq	%r12, %rdi
	callq	_ARRAY_SIZE
	movl	%ebx, %edi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_zx_vou_config_dividers
	movq	%r15, %rdi
	callq	_zx_tvenc_find_zmode
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	_VENC_VIDEO_INFO@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	56(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_VIDEO_RES@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	52(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_FIELD1_PARAM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	48(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_FIELD2_PARAM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	44(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_LINE_O_1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	40(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_LINE_E_1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	36(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_LINE_O_2@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	32(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_LINE_E_2@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	28(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_LINE_TIMING_PARAM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	24(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_WEIGHT_VALUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	20(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_BLANK_BLACK_LEVEL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	16(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_BURST_LEVEL@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	12(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_CONTROL_PARAM@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	8(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_SUB_CARRIER_PHASE1@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	4(%rbx), %esi
	callq	_zx_writel
	movq	_VENC_PHASE_LINE_INCR_CVBS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	(%r14), %rdi
	movl	(%rbx), %esi
	callq	_zx_writel
	jmp	LBB0_3
LBB0_1:
	movl	8(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_DRM_DEV_ERROR
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_VOU_DIV_INF,4,2                ## @VOU_DIV_INF
	.comm	_VOU_DIV_4,4,2                  ## @VOU_DIV_4
	.comm	_VOU_DIV_TVENC,4,2              ## @VOU_DIV_TVENC
	.comm	_VOU_DIV_1,4,2                  ## @VOU_DIV_1
	.comm	_VOU_DIV_LAYER,4,2              ## @VOU_DIV_LAYER
	.comm	_VOU_DIV_2,4,2                  ## @VOU_DIV_2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to find zmode\n"

	.comm	_VENC_VIDEO_INFO,8,3            ## @VENC_VIDEO_INFO
	.comm	_VENC_VIDEO_RES,8,3             ## @VENC_VIDEO_RES
	.comm	_VENC_FIELD1_PARAM,8,3          ## @VENC_FIELD1_PARAM
	.comm	_VENC_FIELD2_PARAM,8,3          ## @VENC_FIELD2_PARAM
	.comm	_VENC_LINE_O_1,8,3              ## @VENC_LINE_O_1
	.comm	_VENC_LINE_E_1,8,3              ## @VENC_LINE_E_1
	.comm	_VENC_LINE_O_2,8,3              ## @VENC_LINE_O_2
	.comm	_VENC_LINE_E_2,8,3              ## @VENC_LINE_E_2
	.comm	_VENC_LINE_TIMING_PARAM,8,3     ## @VENC_LINE_TIMING_PARAM
	.comm	_VENC_WEIGHT_VALUE,8,3          ## @VENC_WEIGHT_VALUE
	.comm	_VENC_BLANK_BLACK_LEVEL,8,3     ## @VENC_BLANK_BLACK_LEVEL
	.comm	_VENC_BURST_LEVEL,8,3           ## @VENC_BURST_LEVEL
	.comm	_VENC_CONTROL_PARAM,8,3         ## @VENC_CONTROL_PARAM
	.comm	_VENC_SUB_CARRIER_PHASE1,8,3    ## @VENC_SUB_CARRIER_PHASE1
	.comm	_VENC_PHASE_LINE_INCR_CVBS,8,3  ## @VENC_PHASE_LINE_INCR_CVBS
	.no_dead_strip	_zx_tvenc_encoder_mode_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function zx_tvenc_encoder_mode_set
_zx_tvenc_encoder_mode_set:             ; @zx_tvenc_encoder_mode_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_to_zx_tvenc
	mov	x19, x0
Lloh3:
	adrp	x8, _VOU_DIV_INF@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VOU_DIV_INF@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _VOU_DIV_4@GOTPAGE
Lloh7:
	ldr	x9, [x9, _VOU_DIV_4@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [sp]
Lloh9:
	adrp	x8, _VOU_DIV_TVENC@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VOU_DIV_TVENC@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, _VOU_DIV_1@GOTPAGE
Lloh13:
	ldr	x9, [x9, _VOU_DIV_1@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #8]
Lloh15:
	adrp	x8, _VOU_DIV_LAYER@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VOU_DIV_LAYER@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
Lloh18:
	adrp	x9, _VOU_DIV_2@GOTPAGE
Lloh19:
	ldr	x9, [x9, _VOU_DIV_2@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	stp	w8, w9, [sp, #16]
	ldr	w21, [x21]
	mov	x0, sp
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x1, sp
	mov	x0, x21
	bl	_zx_vou_config_dividers
	mov	x0, x20
	bl	_zx_tvenc_find_zmode
	cbz	x0, LBB0_2
; %bb.1:
	mov	x20, x0
	ldr	x8, [x19]
Lloh21:
	adrp	x9, _VENC_VIDEO_INFO@GOTPAGE
Lloh22:
	ldr	x9, [x9, _VENC_VIDEO_INFO@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #56]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh24:
	adrp	x9, _VENC_VIDEO_RES@GOTPAGE
Lloh25:
	ldr	x9, [x9, _VENC_VIDEO_RES@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #52]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh27:
	adrp	x9, _VENC_FIELD1_PARAM@GOTPAGE
Lloh28:
	ldr	x9, [x9, _VENC_FIELD1_PARAM@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #48]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh30:
	adrp	x9, _VENC_FIELD2_PARAM@GOTPAGE
Lloh31:
	ldr	x9, [x9, _VENC_FIELD2_PARAM@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #44]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh33:
	adrp	x9, _VENC_LINE_O_1@GOTPAGE
Lloh34:
	ldr	x9, [x9, _VENC_LINE_O_1@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #40]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh36:
	adrp	x9, _VENC_LINE_E_1@GOTPAGE
Lloh37:
	ldr	x9, [x9, _VENC_LINE_E_1@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #36]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh39:
	adrp	x9, _VENC_LINE_O_2@GOTPAGE
Lloh40:
	ldr	x9, [x9, _VENC_LINE_O_2@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #32]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh42:
	adrp	x9, _VENC_LINE_E_2@GOTPAGE
Lloh43:
	ldr	x9, [x9, _VENC_LINE_E_2@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #28]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh45:
	adrp	x9, _VENC_LINE_TIMING_PARAM@GOTPAGE
Lloh46:
	ldr	x9, [x9, _VENC_LINE_TIMING_PARAM@GOTPAGEOFF]
Lloh47:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #24]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh48:
	adrp	x9, _VENC_WEIGHT_VALUE@GOTPAGE
Lloh49:
	ldr	x9, [x9, _VENC_WEIGHT_VALUE@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #20]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh51:
	adrp	x9, _VENC_BLANK_BLACK_LEVEL@GOTPAGE
Lloh52:
	ldr	x9, [x9, _VENC_BLANK_BLACK_LEVEL@GOTPAGEOFF]
Lloh53:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #16]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh54:
	adrp	x9, _VENC_BURST_LEVEL@GOTPAGE
Lloh55:
	ldr	x9, [x9, _VENC_BURST_LEVEL@GOTPAGEOFF]
Lloh56:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #12]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh57:
	adrp	x9, _VENC_CONTROL_PARAM@GOTPAGE
Lloh58:
	ldr	x9, [x9, _VENC_CONTROL_PARAM@GOTPAGEOFF]
Lloh59:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #8]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh60:
	adrp	x9, _VENC_SUB_CARRIER_PHASE1@GOTPAGE
Lloh61:
	ldr	x9, [x9, _VENC_SUB_CARRIER_PHASE1@GOTPAGEOFF]
Lloh62:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20, #4]
	bl	_zx_writel
	ldr	x8, [x19]
Lloh63:
	adrp	x9, _VENC_PHASE_LINE_INCR_CVBS@GOTPAGE
Lloh64:
	ldr	x9, [x9, _VENC_PHASE_LINE_INCR_CVBS@GOTPAGEOFF]
Lloh65:
	ldr	x9, [x9]
	add	x0, x9, x8
	ldr	w1, [x20]
	bl	_zx_writel
	b	LBB0_3
LBB0_2:
	ldr	w0, [x19, #8]
Lloh66:
	adrp	x1, l_.str@PAGE
Lloh67:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
LBB0_3:
	ldr	x8, [sp, #24]
Lloh68:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh69:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh70:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	bl	___stack_chk_fail
	.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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.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
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.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 AdrpAdd	Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.cfi_endproc
                                        ; -- End function
	.comm	_VOU_DIV_INF,4,2                ; @VOU_DIV_INF
	.comm	_VOU_DIV_4,4,2                  ; @VOU_DIV_4
	.comm	_VOU_DIV_TVENC,4,2              ; @VOU_DIV_TVENC
	.comm	_VOU_DIV_1,4,2                  ; @VOU_DIV_1
	.comm	_VOU_DIV_LAYER,4,2              ; @VOU_DIV_LAYER
	.comm	_VOU_DIV_2,4,2                  ; @VOU_DIV_2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to find zmode\n"

	.comm	_VENC_VIDEO_INFO,8,3            ; @VENC_VIDEO_INFO
	.comm	_VENC_VIDEO_RES,8,3             ; @VENC_VIDEO_RES
	.comm	_VENC_FIELD1_PARAM,8,3          ; @VENC_FIELD1_PARAM
	.comm	_VENC_FIELD2_PARAM,8,3          ; @VENC_FIELD2_PARAM
	.comm	_VENC_LINE_O_1,8,3              ; @VENC_LINE_O_1
	.comm	_VENC_LINE_E_1,8,3              ; @VENC_LINE_E_1
	.comm	_VENC_LINE_O_2,8,3              ; @VENC_LINE_O_2
	.comm	_VENC_LINE_E_2,8,3              ; @VENC_LINE_E_2
	.comm	_VENC_LINE_TIMING_PARAM,8,3     ; @VENC_LINE_TIMING_PARAM
	.comm	_VENC_WEIGHT_VALUE,8,3          ; @VENC_WEIGHT_VALUE
	.comm	_VENC_BLANK_BLACK_LEVEL,8,3     ; @VENC_BLANK_BLACK_LEVEL
	.comm	_VENC_BURST_LEVEL,8,3           ; @VENC_BURST_LEVEL
	.comm	_VENC_CONTROL_PARAM,8,3         ; @VENC_CONTROL_PARAM
	.comm	_VENC_SUB_CARRIER_PHASE1,8,3    ; @VENC_SUB_CARRIER_PHASE1
	.comm	_VENC_PHASE_LINE_INCR_CVBS,8,3  ; @VENC_PHASE_LINE_INCR_CVBS
	.no_dead_strip	_zx_tvenc_encoder_mode_set
.subsections_via_symbols
