	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ptn5150_init_dev_type
_ptn5150_init_dev_type:                 ## @ptn5150_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movl	4(%rdi), %edi
	movq	_PTN5150_REG_DEVICE_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_7
LBB0_2:
	movl	-12(%rbp), %edx
	movq	_PTN5150_REG_DEVICE_ID_VENDOR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%edx, %eax
	movq	_PTN5150_REG_DEVICE_ID_VENDOR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %eax
	movq	_PTN5150_REG_DEVICE_ID_VERSION_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	movq	_PTN5150_REG_DEVICE_ID_VERSION_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrl	%cl, %edx
	movl	(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %ecx
	callq	_dev_info
	movl	4(%rbx), %edi
	movq	_PTN5150_REG_INT_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_7
LBB0_4:
	movl	4(%rbx), %edi
	movq	_PTN5150_REG_INT_REG_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-12(%rbp), %rdx
	callq	_regmap_read
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
LBB0_7:
	movl	%eax, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_5:
	xorl	%eax, %eax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_PTN5150_REG_DEVICE_ID,4,2      ## @PTN5150_REG_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read DEVICE_ID %d\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PTN5150_REG_DEVICE_ID_VENDOR_MASK,4,2 ## @PTN5150_REG_DEVICE_ID_VENDOR_MASK
	.comm	_PTN5150_REG_DEVICE_ID_VENDOR_SHIFT,4,2 ## @PTN5150_REG_DEVICE_ID_VENDOR_SHIFT
	.comm	_PTN5150_REG_DEVICE_ID_VERSION_MASK,4,2 ## @PTN5150_REG_DEVICE_ID_VERSION_MASK
	.comm	_PTN5150_REG_DEVICE_ID_VERSION_SHIFT,4,2 ## @PTN5150_REG_DEVICE_ID_VERSION_SHIFT
L_.str.1:                               ## @.str.1
	.asciz	"Device type: version: 0x%x, vendor: 0x%x\n"

	.comm	_PTN5150_REG_INT_STATUS,4,2     ## @PTN5150_REG_INT_STATUS
L_.str.2:                               ## @.str.2
	.asciz	"failed to read PTN5150_REG_INT_STATUS %d\n"

	.comm	_PTN5150_REG_INT_REG_STATUS,4,2 ## @PTN5150_REG_INT_REG_STATUS
L_.str.3:                               ## @.str.3
	.asciz	"failed to read PTN5150_REG_INT_REG_STATUS %d\n"

	.no_dead_strip	_ptn5150_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 ptn5150_init_dev_type
_ptn5150_init_dev_type:                 ; @ptn5150_init_dev_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, _PTN5150_REG_DEVICE_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PTN5150_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]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_2:
	ldr	w8, [sp, #12]
Lloh5:
	adrp	x9, _PTN5150_REG_DEVICE_ID_VENDOR_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _PTN5150_REG_DEVICE_ID_VENDOR_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _PTN5150_REG_DEVICE_ID_VENDOR_SHIFT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _PTN5150_REG_DEVICE_ID_VENDOR_SHIFT@GOTPAGEOFF]
	and	w9, w9, w8
Lloh10:
	ldr	w10, [x10]
	lsr	w3, w9, w10
Lloh11:
	adrp	x9, _PTN5150_REG_DEVICE_ID_VERSION_MASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PTN5150_REG_DEVICE_ID_VERSION_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh14:
	adrp	x9, _PTN5150_REG_DEVICE_ID_VERSION_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PTN5150_REG_DEVICE_ID_VERSION_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	lsr	w2, w8, w9
	ldr	w0, [x19]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	ldr	w0, [x19, #4]
Lloh19:
	adrp	x8, _PTN5150_REG_INT_STATUS@GOTPAGE
Lloh20:
	ldr	x8, [x8, _PTN5150_REG_INT_STATUS@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_4
; %bb.3:
	mov	x2, x0
	ldr	w0, [x19]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
	ldr	w0, [x19, #4]
Lloh24:
	adrp	x8, _PTN5150_REG_INT_REG_STATUS@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PTN5150_REG_INT_REG_STATUS@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_regmap_read
	cbz	w0, LBB0_7
; %bb.5:
	mov	x2, x0
	ldr	w0, [x19]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_6:
	bl	_dev_err
Lloh29:
	adrp	x8, _EINVAL@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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 AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_PTN5150_REG_DEVICE_ID,4,2      ; @PTN5150_REG_DEVICE_ID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read DEVICE_ID %d\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PTN5150_REG_DEVICE_ID_VENDOR_MASK,4,2 ; @PTN5150_REG_DEVICE_ID_VENDOR_MASK
	.comm	_PTN5150_REG_DEVICE_ID_VENDOR_SHIFT,4,2 ; @PTN5150_REG_DEVICE_ID_VENDOR_SHIFT
	.comm	_PTN5150_REG_DEVICE_ID_VERSION_MASK,4,2 ; @PTN5150_REG_DEVICE_ID_VERSION_MASK
	.comm	_PTN5150_REG_DEVICE_ID_VERSION_SHIFT,4,2 ; @PTN5150_REG_DEVICE_ID_VERSION_SHIFT
l_.str.1:                               ; @.str.1
	.asciz	"Device type: version: 0x%x, vendor: 0x%x\n"

	.comm	_PTN5150_REG_INT_STATUS,4,2     ; @PTN5150_REG_INT_STATUS
l_.str.2:                               ; @.str.2
	.asciz	"failed to read PTN5150_REG_INT_STATUS %d\n"

	.comm	_PTN5150_REG_INT_REG_STATUS,4,2 ; @PTN5150_REG_INT_REG_STATUS
l_.str.3:                               ; @.str.3
	.asciz	"failed to read PTN5150_REG_INT_REG_STATUS %d\n"

	.no_dead_strip	_ptn5150_init_dev_type
.subsections_via_symbols
