	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twl4030_starton_mask_and_set
_twl4030_starton_mask_and_set:          ## @twl4030_starton_mask_and_set
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -68(%rbp)                 ## 4-byte Spill
	movl	%edi, %r15d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_TWL4030_PM_MASTER_CFG_P1_TRANSITION@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	%ebx, -60(%rbp)
	movq	_TWL4030_PM_MASTER_CFG_P2_TRANSITION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_TWL4030_PM_MASTER_CFG_P3_TRANSITION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_TWL_MODULE_PM_MASTER@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_TWL4030_PM_MASTER_KEY_CFG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TWL4030_PM_MASTER_PROTECT_KEY@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	callq	_twl_i2c_write_u8
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movl	(%r13), %edi
	movq	_TWL4030_PM_MASTER_KEY_CFG2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r14), %edx
	callq	_twl_i2c_write_u8
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	movl	(%r13), %edi
	leaq	-64(%rbp), %rsi
	movl	%ebx, %edx
	callq	_twl_i2c_read_u8
	testl	%eax, %eax
	je	LBB0_3
LBB0_7:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	movq	_TWL4030_PM_MASTER_PROTECT_KEY@GOTPCREL(%rip), %r14
LBB0_8:
	movl	(%r13), %edi
	movl	(%r14), %edx
	xorl	%esi, %esi
	callq	_twl_i2c_write_u8
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_10
## %bb.9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	andl	%r15d, -68(%rbp)                ## 4-byte Folded Spill
	notl	%r15d
	movl	$1, %r12d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	-64(%rbp), %esi
	andl	%r15d, %esi
	orl	-68(%rbp), %esi                 ## 4-byte Folded Reload
	movl	%esi, -64(%rbp)
	movl	(%r13), %edi
	movl	%ebx, %edx
	callq	_twl_i2c_write_u8
	testl	%eax, %eax
	jne	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpq	$12, %r12
	movq	_TWL4030_PM_MASTER_PROTECT_KEY@GOTPCREL(%rip), %r14
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	-60(%rbp,%r12,4), %ebx
	movl	(%r13), %edi
	leaq	-64(%rbp), %rsi
	movl	%ebx, %edx
	callq	_twl_i2c_read_u8
	incq	%r12
	testl	%eax, %eax
	je	LBB0_6
	jmp	LBB0_7
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TWL4030_PM_MASTER_CFG_P1_TRANSITION,4,2 ## @TWL4030_PM_MASTER_CFG_P1_TRANSITION
	.comm	_TWL4030_PM_MASTER_CFG_P2_TRANSITION,4,2 ## @TWL4030_PM_MASTER_CFG_P2_TRANSITION
	.comm	_TWL4030_PM_MASTER_CFG_P3_TRANSITION,4,2 ## @TWL4030_PM_MASTER_CFG_P3_TRANSITION
	.comm	_TWL_MODULE_PM_MASTER,4,2       ## @TWL_MODULE_PM_MASTER
	.comm	_TWL4030_PM_MASTER_KEY_CFG1,4,2 ## @TWL4030_PM_MASTER_KEY_CFG1
	.comm	_TWL4030_PM_MASTER_PROTECT_KEY,4,2 ## @TWL4030_PM_MASTER_PROTECT_KEY
	.comm	_TWL4030_PM_MASTER_KEY_CFG2,4,2 ## @TWL4030_PM_MASTER_KEY_CFG2
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TWL4030 Register access failed: %i\n"

	.no_dead_strip	_twl4030_starton_mask_and_set
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twl4030_starton_mask_and_set
_twl4030_starton_mask_and_set:          ; @twl4030_starton_mask_and_set
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _TWL4030_PM_MASTER_CFG_P1_TRANSITION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TWL4030_PM_MASTER_CFG_P1_TRANSITION@GOTPAGEOFF]
Lloh5:
	ldr	w19, [x8]
Lloh6:
	adrp	x8, _TWL4030_PM_MASTER_CFG_P2_TRANSITION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TWL4030_PM_MASTER_CFG_P2_TRANSITION@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _TWL4030_PM_MASTER_CFG_P3_TRANSITION@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TWL4030_PM_MASTER_CFG_P3_TRANSITION@GOTPAGEOFF]
	stp	w19, w8, [sp, #12]
Lloh11:
	ldr	w8, [x9]
	str	w8, [sp, #20]
Lloh12:
	adrp	x22, _TWL_MODULE_PM_MASTER@GOTPAGE
Lloh13:
	ldr	x22, [x22, _TWL_MODULE_PM_MASTER@GOTPAGEOFF]
	ldr	w0, [x22]
Lloh14:
	adrp	x8, _TWL4030_PM_MASTER_KEY_CFG1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TWL4030_PM_MASTER_KEY_CFG1@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x23, _TWL4030_PM_MASTER_PROTECT_KEY@GOTPAGE
Lloh18:
	ldr	x23, [x23, _TWL4030_PM_MASTER_PROTECT_KEY@GOTPAGEOFF]
	ldr	w2, [x23]
	bl	_twl_i2c_write_u8
	cbnz	w0, LBB0_9
; %bb.1:
	ldr	w0, [x22]
Lloh19:
	adrp	x8, _TWL4030_PM_MASTER_KEY_CFG2@GOTPAGE
Lloh20:
	ldr	x8, [x8, _TWL4030_PM_MASTER_KEY_CFG2@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	ldr	w2, [x23]
	bl	_twl_i2c_write_u8
	cbnz	w0, LBB0_9
; %bb.2:
	ldr	w0, [x22]
	add	x1, sp, #8
	mov	x2, x19
	bl	_twl_i2c_read_u8
	mov	x1, x0
	cbnz	w0, LBB0_8
; %bb.3:
	mvn	w24, w21
	and	w20, w20, w21
	mov	w21, #4
	add	x25, sp, #12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [sp, #8]
	and	w8, w8, w24
	orr	w1, w8, w20
	str	w1, [sp, #8]
	ldr	w0, [x22]
	mov	x2, x19
	bl	_twl_i2c_write_u8
	cbnz	w0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	x21, #48
	b.eq	LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w19, [x25, x21]
	ldr	w0, [x22]
	add	x1, sp, #8
	mov	x2, x19
	bl	_twl_i2c_read_u8
	add	x21, x21, #4
	cbz	w0, LBB0_4
LBB0_7:
	mov	x1, x0
LBB0_8:
Lloh22:
	adrp	x0, l_.str@PAGE
Lloh23:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
LBB0_9:
	ldr	w0, [x22]
	ldr	w2, [x23]
	mov	w1, #0
	bl	_twl_i2c_write_u8
	ldr	x8, [sp, #24]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_11
; %bb.10:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_TWL4030_PM_MASTER_CFG_P1_TRANSITION,4,2 ; @TWL4030_PM_MASTER_CFG_P1_TRANSITION
	.comm	_TWL4030_PM_MASTER_CFG_P2_TRANSITION,4,2 ; @TWL4030_PM_MASTER_CFG_P2_TRANSITION
	.comm	_TWL4030_PM_MASTER_CFG_P3_TRANSITION,4,2 ; @TWL4030_PM_MASTER_CFG_P3_TRANSITION
	.comm	_TWL_MODULE_PM_MASTER,4,2       ; @TWL_MODULE_PM_MASTER
	.comm	_TWL4030_PM_MASTER_KEY_CFG1,4,2 ; @TWL4030_PM_MASTER_KEY_CFG1
	.comm	_TWL4030_PM_MASTER_PROTECT_KEY,4,2 ; @TWL4030_PM_MASTER_PROTECT_KEY
	.comm	_TWL4030_PM_MASTER_KEY_CFG2,4,2 ; @TWL4030_PM_MASTER_KEY_CFG2
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TWL4030 Register access failed: %i\n"

	.no_dead_strip	_twl4030_starton_mask_and_set
.subsections_via_symbols
