	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ch7006_encoder_detect
_ch7006_encoder_detect:                 ## @ch7006_encoder_detect
	.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	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	callq	_drm_i2c_encoder_get_client
	movq	%rax, %r12
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_to_ch7006_priv
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%rax), %r13
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_ch7006_dbg
	movq	_CH7006_DETECT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ch7006_save_reg
	movq	_CH7006_POWER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rax, %rbx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ch7006_save_reg
	movq	_CH7006_CLKMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ch7006_save_reg
	movl	(%rbx), %r14d
	movq	_CH7006_POWER_RESET@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_CH7006_POWER_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bitfs
	orl	%eax, %r15d
	movq	%r12, %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	callq	_ch7006_write
	movq	_CH7006_CLKMODE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_CH7006_CLKMODE_MASTER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_ch7006_write
	movq	_CH7006_DETECT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	_CH7006_DETECT_SENSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_ch7006_write
	movl	(%rbx), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_ch7006_write
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_ch7006_read
	movl	%eax, %r14d
	movl	(%r15), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ch7006_load_reg
	movq	_CH7006_POWER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ch7006_load_reg
	movl	(%rbx), %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_ch7006_load_reg
	movq	_CH7006_DETECT_SVIDEO_Y_TEST@GOTPCREL(%rip), %rcx
	movq	_CH7006_DETECT_SVIDEO_C_TEST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	_CH7006_DETECT_CVBS_TEST@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%eax, %edx
	orl	%ecx, %edx
	testl	%r14d, %edx
	je	LBB0_1
## %bb.2:
	testl	%r14d, %eax
	je	LBB0_3
## %bb.4:
	testl	%r14d, %ecx
	jne	LBB0_5
## %bb.6:
	movq	_DRM_MODE_SUBCONNECTOR_Composite@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_1:
	movq	_DRM_MODE_SUBCONNECTOR_SCART@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_3:
	movq	_DRM_MODE_SUBCONNECTOR_SVIDEO@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movq	_DRM_MODE_SUBCONNECTOR_Unknown@GOTPCREL(%rip), %rax
LBB0_7:
	movq	(%rax), %rdx
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rdx, (%rbx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_drm_object_property_set_value
	cmpq	$0, (%rbx)
	jne	LBB0_8
## %bb.9:
	movq	_connector_status_disconnected@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
LBB0_10:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_CH7006_DETECT,4,2              ## @CH7006_DETECT
	.comm	_CH7006_POWER,4,2               ## @CH7006_POWER
	.comm	_CH7006_CLKMODE,4,2             ## @CH7006_CLKMODE
	.comm	_CH7006_POWER_RESET,4,2         ## @CH7006_POWER_RESET
	.comm	_CH7006_POWER_LEVEL,4,2         ## @CH7006_POWER_LEVEL
	.comm	_NORMAL,4,2                     ## @NORMAL
	.comm	_CH7006_CLKMODE_MASTER,4,2      ## @CH7006_CLKMODE_MASTER
	.comm	_CH7006_DETECT_SENSE,4,2        ## @CH7006_DETECT_SENSE
	.comm	_CH7006_DETECT_SVIDEO_Y_TEST,4,2 ## @CH7006_DETECT_SVIDEO_Y_TEST
	.comm	_CH7006_DETECT_SVIDEO_C_TEST,4,2 ## @CH7006_DETECT_SVIDEO_C_TEST
	.comm	_CH7006_DETECT_CVBS_TEST,4,2    ## @CH7006_DETECT_CVBS_TEST
	.comm	_DRM_MODE_SUBCONNECTOR_SCART,8,3 ## @DRM_MODE_SUBCONNECTOR_SCART
	.comm	_DRM_MODE_SUBCONNECTOR_SVIDEO,8,3 ## @DRM_MODE_SUBCONNECTOR_SVIDEO
	.comm	_DRM_MODE_SUBCONNECTOR_Composite,8,3 ## @DRM_MODE_SUBCONNECTOR_Composite
	.comm	_DRM_MODE_SUBCONNECTOR_Unknown,8,3 ## @DRM_MODE_SUBCONNECTOR_Unknown
	.comm	_connector_status_connected,4,2 ## @connector_status_connected
	.comm	_connector_status_disconnected,4,2 ## @connector_status_disconnected
	.no_dead_strip	_ch7006_encoder_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ch7006_encoder_detect
_ch7006_encoder_detect:                 ; @ch7006_encoder_detect
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
	bl	_drm_i2c_encoder_get_client
	mov	x22, x0
	mov	x0, x20
	bl	_to_ch7006_priv
	mov	x21, x0
	add	x23, x0, #8
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_ch7006_dbg
Lloh2:
	adrp	x25, _CH7006_DETECT@GOTPAGE
Lloh3:
	ldr	x25, [x25, _CH7006_DETECT@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x22
	mov	x1, x23
	bl	_ch7006_save_reg
Lloh4:
	adrp	x26, _CH7006_POWER@GOTPAGE
Lloh5:
	ldr	x26, [x26, _CH7006_POWER@GOTPAGEOFF]
	ldr	w2, [x26]
	mov	x0, x22
	mov	x1, x23
	bl	_ch7006_save_reg
Lloh6:
	adrp	x27, _CH7006_CLKMODE@GOTPAGE
Lloh7:
	ldr	x27, [x27, _CH7006_CLKMODE@GOTPAGEOFF]
	ldr	w2, [x27]
	mov	x0, x22
	mov	x1, x23
	bl	_ch7006_save_reg
	ldr	w24, [x26]
Lloh8:
	adrp	x8, _CH7006_POWER_RESET@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CH7006_POWER_RESET@GOTPAGEOFF]
Lloh10:
	ldr	w28, [x8]
Lloh11:
	adrp	x8, _CH7006_POWER_LEVEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CH7006_POWER_LEVEL@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x8, _NORMAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _NORMAL@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_bitfs
	orr	w2, w0, w28
	mov	x0, x22
	mov	x1, x24
	bl	_ch7006_write
	ldr	w1, [x27]
Lloh17:
	adrp	x8, _CH7006_CLKMODE_MASTER@GOTPAGE
Lloh18:
	ldr	x8, [x8, _CH7006_CLKMODE_MASTER@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_ch7006_write
	ldr	w1, [x25]
Lloh20:
	adrp	x8, _CH7006_DETECT_SENSE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CH7006_DETECT_SENSE@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x22
	bl	_ch7006_write
	ldr	w1, [x25]
	mov	x0, x22
	mov	w2, #0
	bl	_ch7006_write
	ldr	w1, [x25]
	mov	x0, x22
	bl	_ch7006_read
	mov	x24, x0
	ldr	w2, [x27]
	mov	x0, x22
	mov	x1, x23
	bl	_ch7006_load_reg
	ldr	w2, [x26]
	mov	x0, x22
	mov	x1, x23
	bl	_ch7006_load_reg
	ldr	w2, [x25]
	mov	x0, x22
	mov	x1, x23
	bl	_ch7006_load_reg
Lloh23:
	adrp	x8, _CH7006_DETECT_SVIDEO_Y_TEST@GOTPAGE
Lloh24:
	ldr	x8, [x8, _CH7006_DETECT_SVIDEO_Y_TEST@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _CH7006_DETECT_SVIDEO_C_TEST@GOTPAGE
Lloh27:
	ldr	x9, [x9, _CH7006_DETECT_SVIDEO_C_TEST@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w9, w9, w8
Lloh29:
	adrp	x8, _CH7006_DETECT_CVBS_TEST@GOTPAGE
Lloh30:
	ldr	x8, [x8, _CH7006_DETECT_CVBS_TEST@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	orr	w10, w9, w8
	tst	w10, w24
	b.eq	LBB0_3
; %bb.1:
	tst	w9, w24
	b.eq	LBB0_4
; %bb.2:
Lloh32:
	adrp	x9, _DRM_MODE_SUBCONNECTOR_Unknown@GOTPAGE
Lloh33:
	ldr	x9, [x9, _DRM_MODE_SUBCONNECTOR_Unknown@GOTPAGEOFF]
Lloh34:
	adrp	x10, _DRM_MODE_SUBCONNECTOR_Composite@GOTPAGE
Lloh35:
	ldr	x10, [x10, _DRM_MODE_SUBCONNECTOR_Composite@GOTPAGEOFF]
	tst	w8, w24
	csel	x8, x10, x9, eq
	b	LBB0_5
LBB0_3:
Lloh36:
	adrp	x8, _DRM_MODE_SUBCONNECTOR_SCART@GOTPAGE
Lloh37:
	ldr	x8, [x8, _DRM_MODE_SUBCONNECTOR_SCART@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh38:
	adrp	x8, _DRM_MODE_SUBCONNECTOR_SVIDEO@GOTPAGE
Lloh39:
	ldr	x8, [x8, _DRM_MODE_SUBCONNECTOR_SVIDEO@GOTPAGEOFF]
LBB0_5:
	ldr	x2, [x8]
	str	x2, [x21]
	ldr	x8, [x20]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_drm_object_property_set_value
	ldr	x8, [x21]
Lloh40:
	adrp	x9, _connector_status_connected@GOTPAGE
Lloh41:
	ldr	x9, [x9, _connector_status_connected@GOTPAGEOFF]
Lloh42:
	adrp	x10, _connector_status_disconnected@GOTPAGE
Lloh43:
	ldr	x10, [x10, _connector_status_disconnected@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_CH7006_DETECT,4,2              ; @CH7006_DETECT
	.comm	_CH7006_POWER,4,2               ; @CH7006_POWER
	.comm	_CH7006_CLKMODE,4,2             ; @CH7006_CLKMODE
	.comm	_CH7006_POWER_RESET,4,2         ; @CH7006_POWER_RESET
	.comm	_CH7006_POWER_LEVEL,4,2         ; @CH7006_POWER_LEVEL
	.comm	_NORMAL,4,2                     ; @NORMAL
	.comm	_CH7006_CLKMODE_MASTER,4,2      ; @CH7006_CLKMODE_MASTER
	.comm	_CH7006_DETECT_SENSE,4,2        ; @CH7006_DETECT_SENSE
	.comm	_CH7006_DETECT_SVIDEO_Y_TEST,4,2 ; @CH7006_DETECT_SVIDEO_Y_TEST
	.comm	_CH7006_DETECT_SVIDEO_C_TEST,4,2 ; @CH7006_DETECT_SVIDEO_C_TEST
	.comm	_CH7006_DETECT_CVBS_TEST,4,2    ; @CH7006_DETECT_CVBS_TEST
	.comm	_DRM_MODE_SUBCONNECTOR_SCART,8,3 ; @DRM_MODE_SUBCONNECTOR_SCART
	.comm	_DRM_MODE_SUBCONNECTOR_SVIDEO,8,3 ; @DRM_MODE_SUBCONNECTOR_SVIDEO
	.comm	_DRM_MODE_SUBCONNECTOR_Composite,8,3 ; @DRM_MODE_SUBCONNECTOR_Composite
	.comm	_DRM_MODE_SUBCONNECTOR_Unknown,8,3 ; @DRM_MODE_SUBCONNECTOR_Unknown
	.comm	_connector_status_connected,4,2 ; @connector_status_connected
	.comm	_connector_status_disconnected,4,2 ; @connector_status_disconnected
	.no_dead_strip	_ch7006_encoder_detect
.subsections_via_symbols
