	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ch7006_setup_power_state       ## -- Begin function ch7006_setup_power_state
	.p2align	4, 0x90
_ch7006_setup_power_state:              ## @ch7006_setup_power_state
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	callq	_to_ch7006_priv
	movq	24(%rax), %r14
	movq	_CH7006_POWER@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rbx
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jne	LBB0_2
## %bb.1:
	movl	4(%rax), %ecx
LBB0_2:
	movq	_CH7006_POWER_RESET@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, (%r14,%rbx,4)
	movq	8(%rax), %rdx
	movq	_DRM_MODE_DPMS_ON@GOTPCREL(%rip), %rsi
	cmpq	(%rsi), %rdx
	jne	LBB0_9
## %bb.3:
	cmpl	$130, %ecx
	je	LBB0_7
## %bb.4:
	cmpl	$129, %ecx
	je	LBB0_8
## %bb.5:
	cmpl	$128, %ecx
	jne	LBB0_14
## %bb.6:
	movq	_CH7006_POWER_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_CVBS_OFF@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_9:
	cmpl	$32, 16(%rax)
	movq	_CH7006_POWER_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	jl	LBB0_11
## %bb.10:
	movq	_FULL_POWER_OFF@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_POWER_OFF@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_7:
	movq	_CH7006_POWER_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SVIDEO_OFF@GOTPCREL(%rip), %rax
LBB0_12:
	movl	(%rax), %esi
	callq	_bitfs
	movl	(%r14,%rbx,4), %ecx
LBB0_13:
	orl	%ecx, %eax
	movl	%eax, (%r14,%rbx,4)
LBB0_14:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	movq	_CH7006_POWER_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bitfs
	movl	%eax, %ecx
	movq	_CH7006_POWER_SCART@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	(%r14,%rbx,4), %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_CH7006_POWER,8,3               ## @CH7006_POWER
	.comm	_CH7006_POWER_RESET,4,2         ## @CH7006_POWER_RESET
	.comm	_DRM_MODE_DPMS_ON,8,3           ## @DRM_MODE_DPMS_ON
	.comm	_CH7006_POWER_LEVEL,4,2         ## @CH7006_POWER_LEVEL
	.comm	_CVBS_OFF,4,2                   ## @CVBS_OFF
	.comm	_SVIDEO_OFF,4,2                 ## @SVIDEO_OFF
	.comm	_NORMAL,4,2                     ## @NORMAL
	.comm	_CH7006_POWER_SCART,4,2         ## @CH7006_POWER_SCART
	.comm	_FULL_POWER_OFF,4,2             ## @FULL_POWER_OFF
	.comm	_POWER_OFF,4,2                  ## @POWER_OFF
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ch7006_setup_power_state       ; -- Begin function ch7006_setup_power_state
	.p2align	2
_ch7006_setup_power_state:              ; @ch7006_setup_power_state
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_to_ch7006_priv
	ldr	x19, [x0, #24]
Lloh0:
	adrp	x8, _CH7006_POWER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CH7006_POWER@GOTPAGEOFF]
Lloh2:
	ldr	x20, [x8]
	ldr	w8, [x0]
	cbnz	w8, LBB0_2
; %bb.1:
	ldr	w8, [x0, #4]
LBB0_2:
Lloh3:
	adrp	x9, _CH7006_POWER_RESET@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CH7006_POWER_RESET@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	str	w9, [x19, x20, lsl #2]
	ldr	x9, [x0, #8]
Lloh6:
	adrp	x10, _DRM_MODE_DPMS_ON@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DRM_MODE_DPMS_ON@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_7
; %bb.3:
	cmp	w8, #130
	b.eq	LBB0_10
; %bb.4:
	cmp	w8, #129
	b.eq	LBB0_14
; %bb.5:
	cmp	w8, #128
	b.ne	LBB0_13
; %bb.6:
Lloh9:
	adrp	x8, _CH7006_POWER_LEVEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _CH7006_POWER_LEVEL@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x8, _CVBS_OFF@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CVBS_OFF@GOTPAGEOFF]
	b	LBB0_11
LBB0_7:
	ldr	w8, [x0, #16]
Lloh14:
	adrp	x9, _CH7006_POWER_LEVEL@GOTPAGE
Lloh15:
	ldr	x9, [x9, _CH7006_POWER_LEVEL@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x9]
	cmp	w8, #32
	b.lt	LBB0_9
; %bb.8:
Lloh17:
	adrp	x8, _FULL_POWER_OFF@GOTPAGE
Lloh18:
	ldr	x8, [x8, _FULL_POWER_OFF@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh19:
	adrp	x8, _POWER_OFF@GOTPAGE
Lloh20:
	ldr	x8, [x8, _POWER_OFF@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh21:
	adrp	x8, _CH7006_POWER_LEVEL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _CH7006_POWER_LEVEL@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
Lloh24:
	adrp	x8, _SVIDEO_OFF@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SVIDEO_OFF@GOTPAGEOFF]
LBB0_11:
	ldr	w1, [x8]
	bl	_bitfs
	ldr	w8, [x19, x20, lsl #2]
LBB0_12:
	orr	w8, w8, w0
	str	w8, [x19, x20, lsl #2]
LBB0_13:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_14:
Lloh26:
	adrp	x8, _CH7006_POWER_LEVEL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CH7006_POWER_LEVEL@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
Lloh29:
	adrp	x8, _NORMAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _NORMAL@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	bl	_bitfs
Lloh32:
	adrp	x8, _CH7006_POWER_SCART@GOTPAGE
Lloh33:
	ldr	x8, [x8, _CH7006_POWER_SCART@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	orr	w8, w8, w0
	ldr	w0, [x19, x20, lsl #2]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CH7006_POWER,8,3               ; @CH7006_POWER
	.comm	_CH7006_POWER_RESET,4,2         ; @CH7006_POWER_RESET
	.comm	_DRM_MODE_DPMS_ON,8,3           ; @DRM_MODE_DPMS_ON
	.comm	_CH7006_POWER_LEVEL,4,2         ; @CH7006_POWER_LEVEL
	.comm	_CVBS_OFF,4,2                   ; @CVBS_OFF
	.comm	_SVIDEO_OFF,4,2                 ; @SVIDEO_OFF
	.comm	_NORMAL,4,2                     ; @NORMAL
	.comm	_CH7006_POWER_SCART,4,2         ; @CH7006_POWER_SCART
	.comm	_FULL_POWER_OFF,4,2             ; @FULL_POWER_OFF
	.comm	_POWER_OFF,4,2                  ; @POWER_OFF
.subsections_via_symbols
