	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function da9062_get_device_type
_da9062_get_device_type:                ## @da9062_get_device_type
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	4(%rdi), %edi
	movq	_DA9062AA_DEVICE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movl	-24(%rbp), %edx
	movq	_DA9062_PMIC_DEVICE_ID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jne	LBB0_4
## %bb.5:
	movl	4(%r14), %edi
	movq	_DA9062AA_VARIANT_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-20(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	js	LBB0_6
## %bb.7:
	movl	%eax, %ebx
	movl	-20(%rbp), %eax
	movq	_DA9062AA_VRC_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%eax, %edx
	movq	_DA9062AA_VRC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %edx
	cmpl	$128, %edx
	leaq	L_.str.4(%rip), %rcx
	leaq	L_.str.5(%rip), %rsi
	cmoveq	%rcx, %rsi
	cmpl	$129, %edx
	leaq	L_.str.3(%rip), %r8
	cmovneq	%rsi, %r8
	movl	(%r14), %edi
	movl	-24(%rbp), %edx
	leaq	L_.str.6(%rip), %rsi
	movl	%eax, %ecx
	callq	_dev_info
	movq	_DA9062AA_MRC_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	-20(%rbp), %edx
	movq	_DA9062AA_MRC_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %edx
	movq	_DA9062_PMIC_VARIANT_MRC_AA@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edx
	jge	LBB0_11
## %bb.8:
	movl	(%r14), %edi
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_9
LBB0_1:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_9:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_6:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_2:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_10:
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DA9062AA_DEVICE_ID,4,2         ## @DA9062AA_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot read chip ID.\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_DA9062_PMIC_DEVICE_ID,4,2      ## @DA9062_PMIC_DEVICE_ID
L_.str.1:                               ## @.str.1
	.asciz	"Invalid device ID: 0x%02x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_DA9062AA_VARIANT_ID,4,2        ## @DA9062AA_VARIANT_ID
L_.str.2:                               ## @.str.2
	.asciz	"Cannot read chip variant id.\n"

	.comm	_DA9062AA_VRC_MASK,4,2          ## @DA9062AA_VRC_MASK
	.comm	_DA9062AA_VRC_SHIFT,4,2         ## @DA9062AA_VRC_SHIFT
L_.str.3:                               ## @.str.3
	.asciz	"DA9061"

L_.str.4:                               ## @.str.4
	.asciz	"DA9062"

L_.str.5:                               ## @.str.5
	.asciz	"Unknown"

L_.str.6:                               ## @.str.6
	.asciz	"Device detected (device-ID: 0x%02X, var-ID: 0x%02X, %s)\n"

	.comm	_DA9062AA_MRC_MASK,4,2          ## @DA9062AA_MRC_MASK
	.comm	_DA9062AA_MRC_SHIFT,4,2         ## @DA9062AA_MRC_SHIFT
	.comm	_DA9062_PMIC_VARIANT_MRC_AA,4,2 ## @DA9062_PMIC_VARIANT_MRC_AA
L_.str.7:                               ## @.str.7
	.asciz	"Cannot support variant MRC: 0x%02X\n"

	.no_dead_strip	_da9062_get_device_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function da9062_get_device_type
_da9062_get_device_type:                ; @da9062_get_device_type
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	ldr	w0, [x0, #4]
Lloh0:
	adrp	x8, _DA9062AA_DEVICE_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DA9062AA_DEVICE_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	tbnz	w0, #31, LBB0_5
; %bb.1:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _DA9062_PMIC_DEVICE_ID@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DA9062_PMIC_DEVICE_ID@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.2:
	ldr	w0, [x19, #4]
Lloh6:
	adrp	x8, _DA9062AA_VARIANT_ID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DA9062AA_VARIANT_ID@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_regmap_read
	tbnz	w0, #31, LBB0_8
; %bb.3:
	mov	x20, x0
	ldp	w3, w2, [sp, #8]
Lloh9:
	adrp	x8, _DA9062AA_VRC_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DA9062AA_VRC_MASK@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w3
Lloh12:
	adrp	x9, _DA9062AA_VRC_SHIFT@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DA9062AA_VRC_SHIFT@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh15:
	adrp	x9, l_.str.5@PAGE
Lloh16:
	add	x9, x9, l_.str.5@PAGEOFF
Lloh17:
	adrp	x10, l_.str.4@PAGE
Lloh18:
	add	x10, x10, l_.str.4@PAGEOFF
	cmp	w8, #128
	csel	x9, x10, x9, eq
Lloh19:
	adrp	x10, l_.str.3@PAGE
Lloh20:
	add	x10, x10, l_.str.3@PAGEOFF
	cmp	w8, #129
	csel	x4, x10, x9, eq
	ldr	w0, [x19]
Lloh21:
	adrp	x1, l_.str.6@PAGE
Lloh22:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_dev_info
	ldr	w8, [sp, #8]
Lloh23:
	adrp	x9, _DA9062AA_MRC_MASK@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DA9062AA_MRC_MASK@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh26:
	adrp	x9, _DA9062AA_MRC_SHIFT@GOTPAGE
Lloh27:
	ldr	x9, [x9, _DA9062AA_MRC_SHIFT@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	asr	w8, w8, w9
Lloh29:
	adrp	x9, _DA9062_PMIC_VARIANT_MRC_AA@GOTPAGE
Lloh30:
	ldr	x9, [x9, _DA9062_PMIC_VARIANT_MRC_AA@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ge	LBB0_11
; %bb.4:
	ldr	w0, [x19]
	str	x8, [sp]
Lloh32:
	adrp	x1, l_.str.7@PAGE
Lloh33:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldr	w0, [x19]
Lloh34:
	adrp	x1, l_.str@PAGE
Lloh35:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_9
LBB0_6:
	ldr	w0, [x19]
	str	x8, [sp]
Lloh36:
	adrp	x1, l_.str.1@PAGE
Lloh37:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_7:
	bl	_dev_err
Lloh38:
	adrp	x8, _ENODEV@GOTPAGE
Lloh39:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	ldr	w0, [x19]
Lloh40:
	adrp	x1, l_.str.2@PAGE
Lloh41:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	bl	_dev_err
Lloh42:
	adrp	x8, _EIO@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_DA9062AA_DEVICE_ID,4,2         ; @DA9062AA_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot read chip ID.\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_DA9062_PMIC_DEVICE_ID,4,2      ; @DA9062_PMIC_DEVICE_ID
l_.str.1:                               ; @.str.1
	.asciz	"Invalid device ID: 0x%02x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_DA9062AA_VARIANT_ID,4,2        ; @DA9062AA_VARIANT_ID
l_.str.2:                               ; @.str.2
	.asciz	"Cannot read chip variant id.\n"

	.comm	_DA9062AA_VRC_MASK,4,2          ; @DA9062AA_VRC_MASK
	.comm	_DA9062AA_VRC_SHIFT,4,2         ; @DA9062AA_VRC_SHIFT
l_.str.3:                               ; @.str.3
	.asciz	"DA9061"

l_.str.4:                               ; @.str.4
	.asciz	"DA9062"

l_.str.5:                               ; @.str.5
	.asciz	"Unknown"

l_.str.6:                               ; @.str.6
	.asciz	"Device detected (device-ID: 0x%02X, var-ID: 0x%02X, %s)\n"

	.comm	_DA9062AA_MRC_MASK,4,2          ; @DA9062AA_MRC_MASK
	.comm	_DA9062AA_MRC_SHIFT,4,2         ; @DA9062AA_MRC_SHIFT
	.comm	_DA9062_PMIC_VARIANT_MRC_AA,4,2 ; @DA9062_PMIC_VARIANT_MRC_AA
l_.str.7:                               ; @.str.7
	.asciz	"Cannot support variant MRC: 0x%02X\n"

	.no_dead_strip	_da9062_get_device_type
.subsections_via_symbols
