	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twl4030_madc_set_power
_twl4030_madc_set_power:                ## @twl4030_madc_set_power
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_TWL_MODULE_MAIN_CHARGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TWL4030_MADC_CTRL1@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	leaq	-36(%rbp), %rsi
	callq	_twl_i2c_read_u8
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_2:
	movq	_TWL4030_MADC_MADCON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.3:
	orl	-36(%rbp), %esi
	jmp	LBB0_5
LBB0_4:
	notl	%esi
	andl	-36(%rbp), %esi
LBB0_5:
	movl	%esi, -36(%rbp)
	movq	_TWL4030_MODULE_MADC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %edx
	callq	_twl_i2c_write_u8
	testl	%eax, %eax
	je	LBB0_9
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movl	(%r14), %edi
	movl	(%r12), %edx
	callq	_dev_err
LBB0_8:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_TWL_MODULE_MAIN_CHARGE,4,2     ## @TWL_MODULE_MAIN_CHARGE
	.comm	_TWL4030_MADC_CTRL1,4,2         ## @TWL4030_MADC_CTRL1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to read madc ctrl1 reg 0x%X\n"

	.comm	_TWL4030_MADC_MADCON,4,2        ## @TWL4030_MADC_MADCON
	.comm	_TWL4030_MODULE_MADC,4,2        ## @TWL4030_MODULE_MADC
L_.str.1:                               ## @.str.1
	.asciz	"unable to write madc ctrl1 reg 0x%X\n"

	.no_dead_strip	_twl4030_madc_set_power
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twl4030_madc_set_power
_twl4030_madc_set_power:                ; @twl4030_madc_set_power
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _TWL_MODULE_MAIN_CHARGE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TWL_MODULE_MAIN_CHARGE@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x22, _TWL4030_MADC_CTRL1@GOTPAGE
Lloh4:
	ldr	x22, [x22, _TWL4030_MADC_CTRL1@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x1, sp, #12
	bl	_twl_i2c_read_u8
	cbz	w0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_2:
Lloh7:
	adrp	x8, _TWL4030_MADC_MADCON@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TWL4030_MADC_MADCON@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cbz	w21, LBB0_4
; %bb.3:
	ldr	w9, [sp, #12]
	orr	w1, w9, w8
	b	LBB0_5
LBB0_4:
	ldr	w9, [sp, #12]
	bic	w1, w9, w8
LBB0_5:
	str	w1, [sp, #12]
Lloh10:
	adrp	x8, _TWL4030_MODULE_MADC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _TWL4030_MODULE_MADC@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	w2, [x22]
	bl	_twl_i2c_write_u8
	mov	x20, x0
	cbz	w0, LBB0_8
; %bb.6:
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	ldr	w0, [x19]
	ldr	w2, [x22]
	bl	_dev_err
LBB0_8:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_TWL_MODULE_MAIN_CHARGE,4,2     ; @TWL_MODULE_MAIN_CHARGE
	.comm	_TWL4030_MADC_CTRL1,4,2         ; @TWL4030_MADC_CTRL1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to read madc ctrl1 reg 0x%X\n"

	.comm	_TWL4030_MADC_MADCON,4,2        ; @TWL4030_MADC_MADCON
	.comm	_TWL4030_MODULE_MADC,4,2        ; @TWL4030_MODULE_MADC
l_.str.1:                               ; @.str.1
	.asciz	"unable to write madc ctrl1 reg 0x%X\n"

	.no_dead_strip	_twl4030_madc_set_power
.subsections_via_symbols
