	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twl6040_power_up_automatic
_twl6040_power_up_automatic:            ## @twl6040_power_up_automatic
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	(%rdi), %edi
	movl	$1, %esi
	callq	_gpio_set_value
	leaq	8(%r15), %rbx
	movl	$144, %edi
	callq	_msecs_to_jiffies
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	xorl	%r14d, %r14d
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
	movq	_TWL6040_REG_INTID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_twl6040_reg_read
	movq	_TWL6040_READYINT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_3
## %bb.2:
	movl	4(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
	movl	(%r15), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_gpio_set_value
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
LBB0_3:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"timeout waiting for READYINT\n"

	.comm	_TWL6040_REG_INTID,4,2          ## @TWL6040_REG_INTID
	.comm	_TWL6040_READYINT,4,2           ## @TWL6040_READYINT
L_.str.1:                               ## @.str.1
	.asciz	"automatic power-up failed\n"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_twl6040_power_up_automatic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twl6040_power_up_automatic
_twl6040_power_up_automatic:            ; @twl6040_power_up_automatic
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	mov	x20, x0
	ldr	w0, [x20], #8
	mov	w1, #1
	bl	_gpio_set_value
	mov	w0, #144
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x20
	bl	_wait_for_completion_timeout
	cbnz	w0, LBB0_2
; %bb.1:
	ldr	w0, [x19, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
Lloh2:
	adrp	x8, _TWL6040_REG_INTID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TWL6040_REG_INTID@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_twl6040_reg_read
Lloh5:
	adrp	x8, _TWL6040_READYINT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TWL6040_READYINT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_4
LBB0_2:
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_4:
	ldr	w0, [x19, #4]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	ldr	w0, [x19]
	mov	w1, #0
	bl	_gpio_set_value
Lloh10:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"timeout waiting for READYINT\n"

	.comm	_TWL6040_REG_INTID,4,2          ; @TWL6040_REG_INTID
	.comm	_TWL6040_READYINT,4,2           ; @TWL6040_READYINT
l_.str.1:                               ; @.str.1
	.asciz	"automatic power-up failed\n"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_twl6040_power_up_automatic
.subsections_via_symbols
