	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ad714x_hw_detect
_ad714x_hw_detect:                      ## @ad714x_hw_detect
	.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
	movq	_AD714X_PARTID_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-10(%rbp), %rdx
	movl	$1, %ecx
	callq	*16(%rdi)
	movzwl	-10(%rbp), %edx
	movl	%edx, %eax
	andl	$-16, %eax
	cmpl	$128, %eax
	jne	LBB0_2
## %bb.1:
	movl	$29000, (%rbx)                  ## imm = 0x7148
	andl	$15, %edx
	movw	%dx, 4(%rbx)
	movl	8(%rbx), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_info
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_2:
	movl	8(%rbx), %edi
	movzwl	%dx, %edx
	leaq	L_.str.4(%rip), %rsi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AD714X_PARTID_REG,4,2          ## @AD714X_PARTID_REG
	.section	__TEXT,__cstring,cstring_literals
L_.str.3:                               ## @.str.3
	.asciz	"found AD7148 captouch, rev:%d\n"

L_.str.4:                               ## @.str.4
	.asciz	"fail to detect AD714X captouch, read ID is %04x\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.no_dead_strip	_ad714x_hw_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ad714x_hw_detect
_ad714x_hw_detect:                      ; @ad714x_hw_detect
	.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	x8, [x0, #16]
Lloh0:
	adrp	x9, _AD714X_PARTID_REG@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AD714X_PARTID_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x9]
	add	x2, sp, #14
	mov	w3, #1
	blr	x8
	ldrh	w2, [sp, #14]
	and	w8, w2, #0xfff0
	cmp	w8, #128
	b.ne	LBB0_2
; %bb.1:
	mov	w8, #29000
	str	w8, [x19]
	and	w2, w2, #0xf
	strh	w2, [x19, #4]
	ldr	w0, [x19, #8]
Lloh3:
	adrp	x1, l_.str.3@PAGE
Lloh4:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_info
	mov	w0, #0
	b	LBB0_3
LBB0_2:
	ldr	w0, [x19, #8]
Lloh5:
	adrp	x1, l_.str.4@PAGE
Lloh6:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_dev_err
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_AD714X_PARTID_REG,4,2          ; @AD714X_PARTID_REG
	.section	__TEXT,__cstring,cstring_literals
l_.str.3:                               ; @.str.3
	.asciz	"found AD7148 captouch, rev:%d\n"

l_.str.4:                               ; @.str.4
	.asciz	"fail to detect AD714X captouch, read ID is %04x\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.no_dead_strip	_ad714x_hw_detect
.subsections_via_symbols
