	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_palmas_ext_control_req_config  ## -- Begin function palmas_ext_control_req_config
	.p2align	4, 0x90
_palmas_ext_control_req_config:         ## @palmas_ext_control_req_config
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_PALMAS_EXT_REQ@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	testl	%edx, (%rax)
	je	LBB0_16
## %bb.1:
	movq	_PALMAS_EXTERNAL_REQSTR_ID_MAX@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jbe	LBB0_16
## %bb.2:
	movl	%edx, %r13d
	movq	%rdi, %r14
	movq	8(%rdi), %rax
	movq	_PALMAS_EXT_CONTROL_NSLEEP@GOTPCREL(%rip), %rdx
	testl	%r13d, (%rdx)
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	je	LBB0_4
## %bb.3:
	movq	_PALMAS_NSLEEP_RES_ASSIGN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_9
LBB0_4:
	movq	_PALMAS_EXT_CONTROL_ENABLE1@GOTPCREL(%rip), %rdx
	testl	%r13d, (%rdx)
	je	LBB0_6
## %bb.5:
	movq	_PALMAS_ENABLE1_RES_ASSIGN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
	movl	$1, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_9
LBB0_6:
	movq	_PALMAS_EXT_CONTROL_ENABLE2@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	andl	(%rcx), %r13d
	setne	%cl
	je	LBB0_8
## %bb.7:
	movq	_PALMAS_ENABLE2_RES_ASSIGN@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r13d
LBB0_8:
	movb	%cl, %dil
	addl	%edi, %edi
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
LBB0_9:
	movq	(%rax), %rax
	movl	%esi, %ecx
	shlq	$4, %rcx
	movl	(%rax,%rcx), %r12d
	addl	8(%rax,%rcx), %r13d
	movq	_PALMAS_RESOURCE_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%r12d, %edi
	callq	_BIT
	movl	%eax, %r15d
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_10
## %bb.11:
	movl	%r12d, %edi
	callq	_BIT
	movl	%eax, %r8d
	jmp	LBB0_12
LBB0_10:
	xorl	%r8d, %r8d
LBB0_12:
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%r13d, %edx
	movl	%r15d, %ecx
	callq	_palmas_update_bits
	testl	%eax, %eax
	js	LBB0_13
## %bb.14:
	movq	_PALMAS_PMU_CONTROL_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_PALMAS_POWER_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_BIT
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	xorl	%r8d, %r8d
	callq	_palmas_update_bits
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_16
## %bb.15:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_16
LBB0_13:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_16:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PALMAS_EXT_REQ,4,2             ## @PALMAS_EXT_REQ
	.comm	_PALMAS_EXTERNAL_REQSTR_ID_MAX,4,2 ## @PALMAS_EXTERNAL_REQSTR_ID_MAX
	.comm	_PALMAS_EXT_CONTROL_NSLEEP,4,2  ## @PALMAS_EXT_CONTROL_NSLEEP
	.comm	_PALMAS_NSLEEP_RES_ASSIGN,4,2   ## @PALMAS_NSLEEP_RES_ASSIGN
	.comm	_PALMAS_EXT_CONTROL_ENABLE1,4,2 ## @PALMAS_EXT_CONTROL_ENABLE1
	.comm	_PALMAS_ENABLE1_RES_ASSIGN,4,2  ## @PALMAS_ENABLE1_RES_ASSIGN
	.comm	_PALMAS_EXT_CONTROL_ENABLE2,4,2 ## @PALMAS_EXT_CONTROL_ENABLE2
	.comm	_PALMAS_ENABLE2_RES_ASSIGN,4,2  ## @PALMAS_ENABLE2_RES_ASSIGN
	.comm	_PALMAS_RESOURCE_BASE,4,2       ## @PALMAS_RESOURCE_BASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Resource reg 0x%02x update failed %d\n"

	.comm	_PALMAS_PMU_CONTROL_BASE,4,2    ## @PALMAS_PMU_CONTROL_BASE
	.comm	_PALMAS_POWER_CTRL,4,2          ## @PALMAS_POWER_CTRL
L_.str.1:                               ## @.str.1
	.asciz	"POWER_CTRL register update failed %d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_palmas_ext_control_req_config  ; -- Begin function palmas_ext_control_req_config
	.p2align	2
_palmas_ext_control_req_config:         ; @palmas_ext_control_req_config
	.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
Lloh0:
	adrp	x8, _PALMAS_EXT_REQ@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PALMAS_EXT_REQ@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w2
Lloh3:
	adrp	x9, _PALMAS_EXTERNAL_REQSTR_ID_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PALMAS_EXTERNAL_REQSTR_ID_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, #0
	ccmp	w9, w1, #0, ne
	b.hi	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_15
LBB0_2:
	mov	x20, x3
	mov	x19, x0
	ldr	x8, [x0, #8]
Lloh6:
	adrp	x9, _PALMAS_EXT_CONTROL_NSLEEP@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PALMAS_EXT_CONTROL_NSLEEP@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w2
	b.eq	LBB0_4
; %bb.3:
	mov	w21, #0
Lloh9:
	adrp	x9, _PALMAS_NSLEEP_RES_ASSIGN@GOTPAGE
Lloh10:
	ldr	x9, [x9, _PALMAS_NSLEEP_RES_ASSIGN@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	b	LBB0_7
LBB0_4:
Lloh12:
	adrp	x9, _PALMAS_EXT_CONTROL_ENABLE1@GOTPAGE
Lloh13:
	ldr	x9, [x9, _PALMAS_EXT_CONTROL_ENABLE1@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	tst	w9, w2
	b.eq	LBB0_6
; %bb.5:
Lloh15:
	adrp	x9, _PALMAS_ENABLE1_RES_ASSIGN@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PALMAS_ENABLE1_RES_ASSIGN@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	mov	w21, #1
	b	LBB0_7
LBB0_6:
Lloh18:
	adrp	x9, _PALMAS_EXT_CONTROL_ENABLE2@GOTPAGE
Lloh19:
	ldr	x9, [x9, _PALMAS_EXT_CONTROL_ENABLE2@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w2
	cset	w9, ne
Lloh21:
	adrp	x10, _PALMAS_ENABLE2_RES_ASSIGN@GOTPAGE
Lloh22:
	ldr	x10, [x10, _PALMAS_ENABLE2_RES_ASSIGN@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	lsl	w21, w9, #1
	csel	w9, wzr, w10, eq
LBB0_7:
	ldr	x8, [x8]
	add	x8, x8, w1, uxtw #4
	ldr	w25, [x8]
	ldr	w8, [x8, #8]
	add	w22, w9, w8
Lloh24:
	adrp	x8, _PALMAS_RESOURCE_BASE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PALMAS_RESOURCE_BASE@GOTPAGEOFF]
Lloh26:
	ldr	w23, [x8]
	mov	x0, x25
	bl	_BIT
	mov	x24, x0
	cbz	w20, LBB0_9
; %bb.8:
	mov	x0, x25
	bl	_BIT
	mov	x4, x0
	b	LBB0_10
LBB0_9:
	mov	w4, #0
LBB0_10:
	mov	x0, x19
	mov	x1, x23
	mov	x2, x22
	mov	x3, x24
	bl	_palmas_update_bits
	tbnz	w0, #31, LBB0_13
; %bb.11:
Lloh27:
	adrp	x8, _PALMAS_PMU_CONTROL_BASE@GOTPAGE
Lloh28:
	ldr	x8, [x8, _PALMAS_PMU_CONTROL_BASE@GOTPAGEOFF]
Lloh29:
	ldr	w20, [x8]
Lloh30:
	adrp	x8, _PALMAS_POWER_CTRL@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PALMAS_POWER_CTRL@GOTPAGEOFF]
Lloh32:
	ldr	w22, [x8]
	mov	x0, x21
	bl	_BIT
	mov	x3, x0
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	mov	w4, #0
	bl	_palmas_update_bits
	mov	x20, x0
	tbz	w0, #31, LBB0_15
; %bb.12:
	ldr	w0, [x19]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	b	LBB0_14
LBB0_13:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh35:
	adrp	x1, l_.str@PAGE
Lloh36:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
LBB0_14:
	bl	_dev_err
LBB0_15:
	mov	x0, x20
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_PALMAS_EXT_REQ,4,2             ; @PALMAS_EXT_REQ
	.comm	_PALMAS_EXTERNAL_REQSTR_ID_MAX,4,2 ; @PALMAS_EXTERNAL_REQSTR_ID_MAX
	.comm	_PALMAS_EXT_CONTROL_NSLEEP,4,2  ; @PALMAS_EXT_CONTROL_NSLEEP
	.comm	_PALMAS_NSLEEP_RES_ASSIGN,4,2   ; @PALMAS_NSLEEP_RES_ASSIGN
	.comm	_PALMAS_EXT_CONTROL_ENABLE1,4,2 ; @PALMAS_EXT_CONTROL_ENABLE1
	.comm	_PALMAS_ENABLE1_RES_ASSIGN,4,2  ; @PALMAS_ENABLE1_RES_ASSIGN
	.comm	_PALMAS_EXT_CONTROL_ENABLE2,4,2 ; @PALMAS_EXT_CONTROL_ENABLE2
	.comm	_PALMAS_ENABLE2_RES_ASSIGN,4,2  ; @PALMAS_ENABLE2_RES_ASSIGN
	.comm	_PALMAS_RESOURCE_BASE,4,2       ; @PALMAS_RESOURCE_BASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Resource reg 0x%02x update failed %d\n"

	.comm	_PALMAS_PMU_CONTROL_BASE,4,2    ; @PALMAS_PMU_CONTROL_BASE
	.comm	_PALMAS_POWER_CTRL,4,2          ; @PALMAS_POWER_CTRL
l_.str.1:                               ; @.str.1
	.asciz	"POWER_CTRL register update failed %d\n"

.subsections_via_symbols
