	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function device_8607_init
_device_8607_init:                      ## @device_8607_init
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	_PM8607_CHIP_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pm860x_reg_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movq	_PM8607_VERSION_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	orl	$16, %ecx
	cmpl	$80, %ecx
	jne	LBB0_17
## %bb.4:
	movl	4(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_info
	movq	_PM8607_BUCK3@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_pm860x_reg_read
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	_PM8607_BUCK3_DOUBLE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.7:
	movl	$1, (%r15)
LBB0_8:
	movq	_PM8607_B0_MISC1@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_pm860x_reg_read
	testl	%eax, %eax
	js	LBB0_9
## %bb.10:
	testq	%r14, %r14
	je	LBB0_11
## %bb.12:
	movq	(%r14), %rax
	movq	_PI2C_PORT@GOTPCREL(%rip), %rdx
	xorl	%ecx, %ecx
	cmpq	(%rdx), %rax
	movq	_PM8607_B0_MISC1_PI2C@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	cmovel	%edx, %ecx
	jmp	LBB0_13
LBB0_1:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_17:
	movl	4(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_5:
	movl	4(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_2
LBB0_9:
	movl	4(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_2
LBB0_11:
	movq	_PM8607_B0_MISC1_PI2C@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%ecx, %ecx
LBB0_13:
	movl	(%r12), %esi
	movq	%rbx, %rdi
	callq	_pm860x_set_bits
	testl	%eax, %eax
	js	LBB0_14
## %bb.15:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_device_irq_init
	testl	%eax, %eax
	js	LBB0_16
## %bb.18:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_device_regulator_init
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_device_rtc_init
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_device_onkey_init
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_device_touch_init
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_device_power_init
	movq	%r15, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_device_codec_init              ## TAILCALL
LBB0_14:
	movl	4(%r15), %edi
	leaq	L_.str.5(%rip), %rsi
LBB0_2:
	movl	%eax, %edx
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_16:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PM8607_CHIP_ID,4,2             ## @PM8607_CHIP_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read CHIP ID: %d\n"

	.comm	_PM8607_VERSION_MASK,4,2        ## @PM8607_VERSION_MASK
L_.str.1:                               ## @.str.1
	.asciz	"Marvell 88PM8607 (ID: %02x) detected\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to detect Marvell 88PM8607. Chip ID: %02x\n"

	.comm	_PM8607_BUCK3,4,2               ## @PM8607_BUCK3
L_.str.3:                               ## @.str.3
	.asciz	"Failed to read BUCK3 register: %d\n"

	.comm	_PM8607_BUCK3_DOUBLE,4,2        ## @PM8607_BUCK3_DOUBLE
	.comm	_PM8607_B0_MISC1,4,2            ## @PM8607_B0_MISC1
L_.str.4:                               ## @.str.4
	.asciz	"Failed to read MISC1 register: %d\n"

	.comm	_PI2C_PORT,8,3                  ## @PI2C_PORT
	.comm	_PM8607_B0_MISC1_PI2C,4,2       ## @PM8607_B0_MISC1_PI2C
L_.str.5:                               ## @.str.5
	.asciz	"Failed to access MISC1:%d\n"

	.no_dead_strip	_device_8607_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function device_8607_init
_device_8607_init:                      ; @device_8607_init
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _PM8607_CHIP_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PM8607_CHIP_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_pm860x_reg_read
	mov	x2, x0
	tbnz	w0, #31, LBB0_8
; %bb.1:
Lloh3:
	adrp	x8, _PM8607_VERSION_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PM8607_VERSION_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	and	w8, w8, w2
	orr	w8, w8, #0x10
	cmp	w8, #80
	b.ne	LBB0_9
; %bb.2:
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
Lloh8:
	adrp	x8, _PM8607_BUCK3@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PM8607_BUCK3@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_pm860x_reg_read
	mov	x2, x0
	tbnz	w0, #31, LBB0_10
; %bb.3:
Lloh11:
	adrp	x8, _PM8607_BUCK3_DOUBLE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PM8607_BUCK3_DOUBLE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w2
	b.eq	LBB0_5
; %bb.4:
	mov	w8, #1
	str	w8, [x19]
LBB0_5:
Lloh14:
	adrp	x22, _PM8607_B0_MISC1@GOTPAGE
Lloh15:
	ldr	x22, [x22, _PM8607_B0_MISC1@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_pm860x_reg_read
	tbnz	w0, #31, LBB0_11
; %bb.6:
	cbz	x20, LBB0_12
; %bb.7:
	ldr	x8, [x20]
Lloh16:
	adrp	x9, _PI2C_PORT@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PI2C_PORT@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
Lloh19:
	adrp	x10, _PM8607_B0_MISC1_PI2C@GOTPAGE
Lloh20:
	ldr	x10, [x10, _PM8607_B0_MISC1_PI2C@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x10]
	cmp	x8, x9
	csel	w3, w2, wzr, eq
	b	LBB0_13
LBB0_8:
	ldr	w0, [x19, #4]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_17
LBB0_9:
	ldr	w0, [x19, #4]
Lloh24:
	adrp	x1, l_.str.2@PAGE
Lloh25:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_17
LBB0_10:
	ldr	w0, [x19, #4]
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_11:
	mov	x2, x0
	ldr	w0, [x19, #4]
Lloh28:
	adrp	x1, l_.str.4@PAGE
Lloh29:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_12:
	mov	w3, #0
Lloh30:
	adrp	x8, _PM8607_B0_MISC1_PI2C@GOTPAGE
Lloh31:
	ldr	x8, [x8, _PM8607_B0_MISC1_PI2C@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
LBB0_13:
	ldr	w1, [x22]
	mov	x0, x21
	bl	_pm860x_set_bits
	tbnz	w0, #31, LBB0_16
; %bb.14:
	mov	x0, x19
	mov	x1, x20
	bl	_device_irq_init
	tbnz	w0, #31, LBB0_18
; %bb.15:
	mov	x0, x19
	mov	x1, x20
	bl	_device_regulator_init
	mov	x0, x19
	mov	x1, x20
	bl	_device_rtc_init
	mov	x0, x19
	mov	x1, x20
	bl	_device_onkey_init
	mov	x0, x19
	mov	x1, x20
	bl	_device_touch_init
	mov	x0, x19
	mov	x1, x20
	bl	_device_power_init
	mov	x0, x19
	mov	x1, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_device_codec_init
LBB0_16:
	mov	x2, x0
	ldr	w0, [x19, #4]
Lloh33:
	adrp	x1, l_.str.5@PAGE
Lloh34:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_17:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_dev_err
LBB0_18:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_PM8607_CHIP_ID,4,2             ; @PM8607_CHIP_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read CHIP ID: %d\n"

	.comm	_PM8607_VERSION_MASK,4,2        ; @PM8607_VERSION_MASK
l_.str.1:                               ; @.str.1
	.asciz	"Marvell 88PM8607 (ID: %02x) detected\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to detect Marvell 88PM8607. Chip ID: %02x\n"

	.comm	_PM8607_BUCK3,4,2               ; @PM8607_BUCK3
l_.str.3:                               ; @.str.3
	.asciz	"Failed to read BUCK3 register: %d\n"

	.comm	_PM8607_BUCK3_DOUBLE,4,2        ; @PM8607_BUCK3_DOUBLE
	.comm	_PM8607_B0_MISC1,4,2            ; @PM8607_B0_MISC1
l_.str.4:                               ; @.str.4
	.asciz	"Failed to read MISC1 register: %d\n"

	.comm	_PI2C_PORT,8,3                  ; @PI2C_PORT
	.comm	_PM8607_B0_MISC1_PI2C,4,2       ; @PM8607_B0_MISC1_PI2C
l_.str.5:                               ; @.str.5
	.asciz	"Failed to access MISC1:%d\n"

	.no_dead_strip	_device_8607_init
.subsections_via_symbols
