	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctrl_power_mode
_ctrl_power_mode:                       ## @ctrl_power_mode
	.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
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.3:
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	16(%rdi), %r12
	movl	(%r12), %ecx
	movl	(%rsi), %eax
	xorl	%ebx, %ebx
	cmpl	%eax, %ecx
	je	LBB0_26
## %bb.4:
	leal	-141(%rax), %edx
	cmpl	$5, %edx
	jae	LBB0_1
## %bb.5:
	movq	(%r15), %rsi
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	8(%r15), %r13
	movslq	%edx, %rdx
	leaq	l_switch.table.ctrl_power_mode(%rip), %rsi
	movq	(%rsi,%rdx,8), %rdx
	movl	(%rdx), %edx
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	cmpl	$141, %ecx
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.6:
	movq	%r15, %rdi
	callq	_power_up_device
	testl	%eax, %eax
	jne	LBB0_22
## %bb.7:
	movl	(%r14), %eax
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_8:
	cmpl	$141, %eax
	jne	LBB0_10
## %bb.9:
	movq	%r13, %rdi
	callq	_drxj_reset_mode
	jmp	LBB0_17
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_26:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	(%r13), %esi
	leal	-128(%rsi), %eax
	cmpl	$12, %eax
	ja	LBB0_27
## %bb.11:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_14:
	movq	%r15, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	$1, %edx
	callq	_power_down_atv
	jmp	LBB0_15
LBB0_12:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_power_down_qam
	jmp	LBB0_15
LBB0_27:
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_13:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_power_down_vsb
LBB0_15:
	testl	%eax, %eax
	jne	LBB0_22
LBB0_16:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	$128, (%r13)
LBB0_17:
	movl	$144, %eax
	cmpl	$144, (%r14)
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_18
LBB0_25:
	movl	%eax, (%r12)
	jmp	LBB0_26
LBB0_18:
	movq	_SIO_CC_PWD_MODE__A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	callq	_drxj_dap_write_reg16
	testl	%eax, %eax
	jne	LBB0_22
## %bb.19:
	movq	_SIO_CC_UPDATE__A@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SIO_CC_UPDATE_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	xorl	%ecx, %ecx
	callq	_drxj_dap_write_reg16
	testl	%eax, %eax
	je	LBB0_20
LBB0_22:
	movl	%eax, %r13d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	movl	%r13d, %ebx
	jmp	LBB0_26
LBB0_20:
	movl	$141, %eax
	cmpl	$141, (%r14)
	je	LBB0_25
## %bb.21:
	movq	%r15, %rdi
	callq	_init_hi
	testl	%eax, %eax
	jne	LBB0_22
## %bb.23:
	movq	_SIO_HI_RA_RAM_PAR_5_CFG_SLEEP_ZZZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	orl	%eax, 4(%rcx)
	movq	%r15, %rdi
	callq	_hi_cfg_command
	testl	%eax, %eax
	je	LBB0_24
## %bb.28:
	movl	%eax, %r15d
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	movl	%r15d, %ebx
	jmp	LBB0_26
LBB0_24:
	movl	(%r14), %eax
	jmp	LBB0_25
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_27, LBB0_27-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
LJTI0_0:
	.long	L0_0_set_16
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_14
	.long	L0_0_set_12
	.long	L0_0_set_12
	.long	L0_0_set_12
	.long	L0_0_set_14
	.long	L0_0_set_27
	.long	L0_0_set_13
	.end_data_region
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SIO_CC_PWD_MODE_LEVEL_NONE,4,2 ## @SIO_CC_PWD_MODE_LEVEL_NONE
	.comm	_SIO_CC_PWD_MODE_LEVEL_CLOCK,4,2 ## @SIO_CC_PWD_MODE_LEVEL_CLOCK
	.comm	_SIO_CC_PWD_MODE_LEVEL_PLL,4,2  ## @SIO_CC_PWD_MODE_LEVEL_PLL
	.comm	_SIO_CC_PWD_MODE_LEVEL_OSC,4,2  ## @SIO_CC_PWD_MODE_LEVEL_OSC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error %d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_SIO_CC_PWD_MODE__A,4,2         ## @SIO_CC_PWD_MODE__A
	.comm	_SIO_CC_UPDATE__A,4,2           ## @SIO_CC_UPDATE__A
	.comm	_SIO_CC_UPDATE_KEY,4,2          ## @SIO_CC_UPDATE_KEY
	.comm	_SIO_HI_RA_RAM_PAR_5_CFG_SLEEP_ZZZ,4,2 ## @SIO_HI_RA_RAM_PAR_5_CFG_SLEEP_ZZZ
	.no_dead_strip	_ctrl_power_mode
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ctrl_power_mode
l_switch.table.ctrl_power_mode:
	.quad	_SIO_CC_PWD_MODE_LEVEL_NONE
	.quad	_SIO_CC_PWD_MODE_LEVEL_OSC
	.quad	_SIO_CC_PWD_MODE_LEVEL_PLL
	.quad	_SIO_CC_PWD_MODE_LEVEL_NONE
	.quad	_SIO_CC_PWD_MODE_LEVEL_CLOCK

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctrl_power_mode
_ctrl_power_mode:                       ; @ctrl_power_mode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	cbz	x1, LBB0_9
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	x25, [x0, #16]
	ldr	w9, [x25]
	ldr	w8, [x1]
	cmp	w9, w8
	b.ne	LBB0_3
; %bb.2:
	mov	w22, #0
	b	LBB0_11
LBB0_3:
	sub	w10, w8, #141
	cmp	w10, #5
	b.hs	LBB0_9
; %bb.4:
	ldp	x23, x21, [x20]
Lloh0:
	adrp	x11, l_switch.table.ctrl_power_mode@PAGE
Lloh1:
	add	x11, x11, l_switch.table.ctrl_power_mode@PAGEOFF
	ldr	x10, [x11, w10, sxtw #3]
	ldr	w24, [x10]
	cmp	w9, #141
	b.eq	LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_power_up_device
	cbnz	w0, LBB0_23
; %bb.6:
	ldr	w8, [x19]
LBB0_7:
	cmp	w8, #141
	b.ne	LBB0_12
; %bb.8:
	mov	x0, x21
	bl	_drxj_reset_mode
	b	LBB0_19
LBB0_9:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_11:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	w1, [x21]
	sub	w8, w1, #128
	cmp	w8, #12
	b.hi	LBB0_16
; %bb.13:
Lloh4:
	adrp	x9, lJTI0_0@PAGE
Lloh5:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_14
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_14:
	mov	x0, x20
	mov	w2, #1
	bl	_power_down_atv
	cbnz	w0, LBB0_23
	b	LBB0_18
LBB0_15:
	mov	x0, x20
	mov	w1, #1
	bl	_power_down_qam
	cbnz	w0, LBB0_23
	b	LBB0_18
LBB0_16:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_10
LBB0_17:
	mov	x0, x20
	mov	w1, #1
	bl	_power_down_vsb
	cbnz	w0, LBB0_23
LBB0_18:
	mov	w8, #128
	str	w8, [x21]
LBB0_19:
	ldr	w8, [x19]
	cmp	w8, #144
	b.ne	LBB0_21
LBB0_20:
	mov	w22, #0
	str	w8, [x25]
	b	LBB0_11
LBB0_21:
Lloh8:
	adrp	x8, _SIO_CC_PWD_MODE__A@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SIO_CC_PWD_MODE__A@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x23
	mov	x2, x24
	mov	w3, #0
	bl	_drxj_dap_write_reg16
	cbnz	w0, LBB0_23
; %bb.22:
Lloh11:
	adrp	x8, _SIO_CC_UPDATE__A@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SIO_CC_UPDATE__A@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _SIO_CC_UPDATE_KEY@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SIO_CC_UPDATE_KEY@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	mov	x0, x23
	mov	w3, #0
	bl	_drxj_dap_write_reg16
	cbz	w0, LBB0_24
LBB0_23:
	mov	x22, x0
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x22
	bl	_pr_err
	b	LBB0_11
LBB0_24:
	ldr	w8, [x19]
	cmp	w8, #141
	b.eq	LBB0_20
; %bb.25:
	mov	x0, x20
	bl	_init_hi
	cbnz	w0, LBB0_23
; %bb.26:
Lloh19:
	adrp	x8, _SIO_HI_RA_RAM_PAR_5_CFG_SLEEP_ZZZ@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SIO_HI_RA_RAM_PAR_5_CFG_SLEEP_ZZZ@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	ldr	w9, [x21, #4]
	orr	w8, w9, w8
	str	w8, [x21, #4]
	mov	x0, x20
	bl	_hi_cfg_command
	cbnz	w0, LBB0_23
; %bb.27:
	ldr	w8, [x19]
	b	LBB0_20
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_18-LBB0_14)>>2
	.byte	(LBB0_14-LBB0_14)>>2
	.byte	(LBB0_14-LBB0_14)>>2
	.byte	(LBB0_14-LBB0_14)>>2
	.byte	(LBB0_14-LBB0_14)>>2
	.byte	(LBB0_14-LBB0_14)>>2
	.byte	(LBB0_14-LBB0_14)>>2
	.byte	(LBB0_15-LBB0_14)>>2
	.byte	(LBB0_15-LBB0_14)>>2
	.byte	(LBB0_15-LBB0_14)>>2
	.byte	(LBB0_14-LBB0_14)>>2
	.byte	(LBB0_16-LBB0_14)>>2
	.byte	(LBB0_17-LBB0_14)>>2
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SIO_CC_PWD_MODE_LEVEL_NONE,4,2 ; @SIO_CC_PWD_MODE_LEVEL_NONE
	.comm	_SIO_CC_PWD_MODE_LEVEL_CLOCK,4,2 ; @SIO_CC_PWD_MODE_LEVEL_CLOCK
	.comm	_SIO_CC_PWD_MODE_LEVEL_PLL,4,2  ; @SIO_CC_PWD_MODE_LEVEL_PLL
	.comm	_SIO_CC_PWD_MODE_LEVEL_OSC,4,2  ; @SIO_CC_PWD_MODE_LEVEL_OSC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error %d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_SIO_CC_PWD_MODE__A,4,2         ; @SIO_CC_PWD_MODE__A
	.comm	_SIO_CC_UPDATE__A,4,2           ; @SIO_CC_UPDATE__A
	.comm	_SIO_CC_UPDATE_KEY,4,2          ; @SIO_CC_UPDATE_KEY
	.comm	_SIO_HI_RA_RAM_PAR_5_CFG_SLEEP_ZZZ,4,2 ; @SIO_HI_RA_RAM_PAR_5_CFG_SLEEP_ZZZ
	.no_dead_strip	_ctrl_power_mode
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ctrl_power_mode
l_switch.table.ctrl_power_mode:
	.quad	_SIO_CC_PWD_MODE_LEVEL_NONE
	.quad	_SIO_CC_PWD_MODE_LEVEL_OSC
	.quad	_SIO_CC_PWD_MODE_LEVEL_PLL
	.quad	_SIO_CC_PWD_MODE_LEVEL_NONE
	.quad	_SIO_CC_PWD_MODE_LEVEL_CLOCK

.subsections_via_symbols
