	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sm5502_init_dev_type
_sm5502_init_dev_type:                  ## @sm5502_init_dev_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	16(%rdi), %edi
	movq	_SM5502_REG_DEVICE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-28(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	20(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_5
LBB0_2:
	movl	-28(%rbp), %edx
	movq	_SM5502_REG_DEVICE_ID_VENDOR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%edx, %eax
	movq	_SM5502_REG_DEVICE_ID_VENDOR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %eax
	movq	_SM5502_REG_DEVICE_ID_VERSION_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	movq	_SM5502_REG_DEVICE_ID_VERSION_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %edx
	movl	20(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %ecx
	callq	_dev_info
	cmpl	$0, (%r14)
	jle	LBB0_5
## %bb.3:
	movl	$8, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rax
	cmpl	$1, (%rax,%rbx)
	movl	$0, %edx
	sbbl	%edx, %edx
	movl	-4(%rax,%rbx), %esi
	xorl	-8(%rax,%rbx), %edx
	movl	16(%r14), %edi
	callq	_regmap_write
	incq	%r15
	movslq	(%r14), %rax
	addq	$12, %rbx
	cmpq	%rax, %r15
	jl	LBB0_4
LBB0_5:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SM5502_REG_DEVICE_ID,4,2       ## @SM5502_REG_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read DEVICE_ID register: %d\n"

	.comm	_SM5502_REG_DEVICE_ID_VENDOR_MASK,4,2 ## @SM5502_REG_DEVICE_ID_VENDOR_MASK
	.comm	_SM5502_REG_DEVICE_ID_VENDOR_SHIFT,4,2 ## @SM5502_REG_DEVICE_ID_VENDOR_SHIFT
	.comm	_SM5502_REG_DEVICE_ID_VERSION_MASK,4,2 ## @SM5502_REG_DEVICE_ID_VERSION_MASK
	.comm	_SM5502_REG_DEVICE_ID_VERSION_SHIFT,4,2 ## @SM5502_REG_DEVICE_ID_VERSION_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"Device type: version: 0x%x, vendor: 0x%x\n"

	.no_dead_strip	_sm5502_init_dev_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sm5502_init_dev_type
_sm5502_init_dev_type:                  ; @sm5502_init_dev_type
	.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	x19, x0
	ldr	w0, [x0, #16]
Lloh0:
	adrp	x8, _SM5502_REG_DEVICE_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SM5502_REG_DEVICE_ID@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_2
; %bb.1:
	mov	x2, x0
	ldr	w0, [x19, #20]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_5
LBB0_2:
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _SM5502_REG_DEVICE_ID_VENDOR_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SM5502_REG_DEVICE_ID_VENDOR_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _SM5502_REG_DEVICE_ID_VENDOR_SHIFT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _SM5502_REG_DEVICE_ID_VENDOR_SHIFT@GOTPAGEOFF]
	and	w9, w9, w8
Lloh10:
	ldr	w10, [x10]
	lsr	w3, w9, w10
Lloh11:
	adrp	x9, _SM5502_REG_DEVICE_ID_VERSION_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _SM5502_REG_DEVICE_ID_VERSION_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh14:
	adrp	x9, _SM5502_REG_DEVICE_ID_VERSION_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _SM5502_REG_DEVICE_ID_VERSION_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	lsr	w2, w8, w9
	ldr	w0, [x19, #20]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_5
; %bb.3:
	mov	x20, #0
	mov	x21, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #8]
	add	x8, x8, x20
	ldp	w1, w9, [x8, #4]
	cmp	w9, #0
	ldr	w9, [x8]
	cinv	w2, w9, eq
	ldr	w0, [x19, #16]
	bl	_regmap_write
	add	x21, x21, #1
	ldrsw	x8, [x19]
	add	x20, x20, #12
	cmp	x21, x8
	b.lt	LBB0_4
LBB0_5:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_SM5502_REG_DEVICE_ID,4,2       ; @SM5502_REG_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read DEVICE_ID register: %d\n"

	.comm	_SM5502_REG_DEVICE_ID_VENDOR_MASK,4,2 ; @SM5502_REG_DEVICE_ID_VENDOR_MASK
	.comm	_SM5502_REG_DEVICE_ID_VENDOR_SHIFT,4,2 ; @SM5502_REG_DEVICE_ID_VENDOR_SHIFT
	.comm	_SM5502_REG_DEVICE_ID_VERSION_MASK,4,2 ; @SM5502_REG_DEVICE_ID_VERSION_MASK
	.comm	_SM5502_REG_DEVICE_ID_VERSION_SHIFT,4,2 ; @SM5502_REG_DEVICE_ID_VERSION_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"Device type: version: 0x%x, vendor: 0x%x\n"

	.no_dead_strip	_sm5502_init_dev_type
.subsections_via_symbols
