	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __rc5t583_set_ext_pwrreq1_control
___rc5t583_set_ext_pwrreq1_control:     ## @__rc5t583_set_ext_pwrreq1_control
	.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
	movl	%esi, %r15d
	movl	$0, -44(%rbp)
	movq	_RC5T583_DS_DC0@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_14
LBB0_2:
	movl	%ecx, %r12d
	movq	_deepsleep_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%r15d, %r14
	movl	(%rax,%r14,8), %r13d
	movl	4(%rax,%r14,8), %esi
	leaq	-44(%rbp), %rdx
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_rc5t583_read
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movl	$15, %eax
	movl	%r13d, %ecx
	shll	%cl, %eax
	notl	%eax
	andl	%eax, -44(%rbp)
	movl	%r13d, %edi
	callq	_BIT
	andl	$7, %r12d
	leal	1(%r13), %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	orl	%eax, %r12d
	orl	%r12d, -44(%rbp)
	movq	_RICOH_ONOFFSEL_REG@GOTPCREL(%rip), %r12
	movl	(%r12), %ebx
	movl	$1, %edi
	callq	_BIT
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_rc5t583_set_bits
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	_deepsleep_data@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movl	4(%rax,%r14,8), %esi
	movl	-44(%rbp), %edx
	movq	%r13, %rdi
	callq	_rc5t583_write
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movq	_RC5T583_DS_LDO4@GOTPCREL(%rip), %rax
	cmpl	%r15d, (%rax)
	jne	LBB0_14
## %bb.9:
	movq	_RICOH_SWCTL_REG@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r13, %rdi
	movl	$1, %edx
	callq	_rc5t583_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_14
## %bb.10:
	movl	(%r15), %edx
	jmp	LBB0_11
LBB0_3:
	movl	%eax, %ebx
	movq	_deepsleep_data@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax,%r14,8), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_5:
	movl	%eax, %ebx
	movl	(%r12), %edx
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_12
LBB0_7:
	movq	(%r12), %rax
	movl	4(%rax,%r14,8), %edx
LBB0_11:
	leaq	L_.str.3(%rip), %rsi
LBB0_12:
	movq	%r13, %rdi
LBB0_13:
	callq	_dev_err
LBB0_14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RC5T583_DS_DC0,4,2             ## @RC5T583_DS_DC0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PWRREQ1 is invalid control for rail %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_deepsleep_data,8,3             ## @deepsleep_data
L_.str.1:                               ## @.str.1
	.asciz	"Error in reading reg 0x%x\n"

	.comm	_RICOH_ONOFFSEL_REG,4,2         ## @RICOH_ONOFFSEL_REG
L_.str.2:                               ## @.str.2
	.asciz	"Error in updating the 0x%02x register\n"

L_.str.3:                               ## @.str.3
	.asciz	"Error in writing reg 0x%x\n"

	.comm	_RC5T583_DS_LDO4,4,2            ## @RC5T583_DS_LDO4
	.comm	_RICOH_SWCTL_REG,4,2            ## @RICOH_SWCTL_REG
	.no_dead_strip	___rc5t583_set_ext_pwrreq1_control
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __rc5t583_set_ext_pwrreq1_control
___rc5t583_set_ext_pwrreq1_control:     ; @__rc5t583_set_ext_pwrreq1_control
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x20, x1
	mov	x19, x0
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _RC5T583_DS_DC0@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RC5T583_DS_DC0@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_2:
	mov	x22, x3
Lloh8:
	adrp	x24, _deepsleep_data@GOTPAGE
Lloh9:
	ldr	x24, [x24, _deepsleep_data@GOTPAGEOFF]
	ldr	x8, [x24]
	sxtw	x25, w20
	add	x8, x8, w20, sxtw #3
	ldp	w23, w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_rc5t583_read
	tbnz	w0, #31, LBB0_8
; %bb.3:
	add	w21, w23, #1
	mov	w8, #15
	lsl	w8, w8, w23
	ldr	w9, [sp, #12]
	bic	w8, w9, w8
	str	w8, [sp, #12]
	mov	x0, x23
	bl	_BIT
	ldr	w8, [sp, #12]
	and	w9, w22, #0x7
	lsl	w9, w9, w21
	orr	w9, w0, w9
	orr	w8, w9, w8
	str	w8, [sp, #12]
Lloh10:
	adrp	x22, _RICOH_ONOFFSEL_REG@GOTPAGE
Lloh11:
	ldr	x22, [x22, _RICOH_ONOFFSEL_REG@GOTPAGEOFF]
	ldr	w21, [x22]
	mov	w0, #1
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x21
	bl	_rc5t583_set_bits
	tbnz	w0, #31, LBB0_9
; %bb.4:
	ldr	x8, [x24]
	add	x8, x8, x25, lsl #3
	ldr	w1, [x8, #4]
	ldr	w2, [sp, #12]
	mov	x0, x19
	bl	_rc5t583_write
	mov	x21, x0
	tbnz	w0, #31, LBB0_10
; %bb.5:
Lloh12:
	adrp	x8, _RC5T583_DS_LDO4@GOTPAGE
Lloh13:
	ldr	x8, [x8, _RC5T583_DS_LDO4@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_13
; %bb.6:
Lloh15:
	adrp	x20, _RICOH_SWCTL_REG@GOTPAGE
Lloh16:
	ldr	x20, [x20, _RICOH_SWCTL_REG@GOTPAGEOFF]
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #1
	bl	_rc5t583_write
	mov	x21, x0
	tbz	w0, #31, LBB0_13
; %bb.7:
	ldr	w2, [x20]
	b	LBB0_11
LBB0_8:
	mov	x21, x0
	ldr	x8, [x24]
	add	x8, x8, x25, lsl #3
	ldr	w2, [x8, #4]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_9:
	mov	x21, x0
	ldr	w2, [x22]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_12
LBB0_10:
	ldr	x8, [x24]
	add	x8, x8, x25, lsl #3
	ldr	w2, [x8, #4]
LBB0_11:
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_dev_err
LBB0_13:
	mov	x0, x21
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_RC5T583_DS_DC0,4,2             ; @RC5T583_DS_DC0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PWRREQ1 is invalid control for rail %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_deepsleep_data,8,3             ; @deepsleep_data
l_.str.1:                               ; @.str.1
	.asciz	"Error in reading reg 0x%x\n"

	.comm	_RICOH_ONOFFSEL_REG,4,2         ; @RICOH_ONOFFSEL_REG
l_.str.2:                               ; @.str.2
	.asciz	"Error in updating the 0x%02x register\n"

l_.str.3:                               ; @.str.3
	.asciz	"Error in writing reg 0x%x\n"

	.comm	_RC5T583_DS_LDO4,4,2            ; @RC5T583_DS_LDO4
	.comm	_RICOH_SWCTL_REG,4,2            ; @RICOH_SWCTL_REG
	.no_dead_strip	___rc5t583_set_ext_pwrreq1_control
.subsections_via_symbols
