	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stmpe_init_hw
_stmpe_init_hw:                         ## @stmpe_init_hw
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	24(%rdi), %r15
	movq	32(%rdi), %rdi
	movq	_STMPE_BLOCK_TOUCHSCREEN@GOTPCREL(%rip), %rax
	movq	_STMPE_BLOCK_ADC@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	orl	(%rax), %esi
	movq	%rdi, %r13
	callq	_stmpe_enable
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
LBB0_14:
	callq	_dev_err
	jmp	LBB0_15
LBB0_2:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%r13, %r15
	movq	%r13, %rdi
	callq	_stmpe811_adc_common_init
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	%eax, %r14d
	movl	(%r12), %esi
	movq	_STMPE_BLOCK_TOUCHSCREEN@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%r15, %rdi
	callq	_stmpe_disable
LBB0_15:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	%rbx, %r12
	movl	(%rbx), %edi
	callq	_STMPE_AVE_CTRL
	movl	%eax, %r13d
	movl	4(%rbx), %edi
	callq	_STMPE_DET_DELAY
	orl	%eax, %r13d
	movl	8(%rbx), %edi
	callq	_STMPE_SETTLING
	orl	%eax, %r13d
	movl	$255, %edi
	callq	_STMPE_AVE_CTRL
	movl	%eax, %ebx
	movl	$255, %edi
	callq	_STMPE_DET_DELAY
	orl	%eax, %ebx
	movl	$255, %edi
	callq	_STMPE_SETTLING
	orl	%eax, %ebx
	movq	_STMPE_REG_TSC_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	movl	%r13d, %ecx
	callq	_stmpe_set_bits
	testl	%eax, %eax
	jne	LBB0_5
## %bb.7:
	movq	_STMPE_REG_TSC_FRACTION_Z@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$255, %edi
	callq	_STMPE_FRACTION_Z
	movl	%eax, %ebx
	movl	12(%r12), %edi
	callq	_STMPE_FRACTION_Z
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_stmpe_set_bits
	testl	%eax, %eax
	jne	LBB0_5
## %bb.8:
	movq	_STMPE_REG_TSC_I_DRIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	$255, %edi
	callq	_STMPE_I_DRIVE
	movl	%eax, %ebx
	movl	16(%r12), %edi
	callq	_STMPE_I_DRIVE
	movq	%r15, %rdi
	movl	%r13d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_stmpe_set_bits
	testl	%eax, %eax
	je	LBB0_9
LBB0_5:
	movl	%eax, %r14d
	leaq	L_.str.1(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_9:
	movq	_STMPE_REG_FIFO_TH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	callq	_stmpe_reg_write
	testl	%eax, %eax
	je	LBB0_11
## %bb.10:
	movl	%eax, %r14d
	leaq	L_.str.2(%rip), %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_14
LBB0_11:
	movq	_STMPE_REG_TSC_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	$255, %edi
	callq	_STMPE_OP_MODE
	movl	%eax, %ebx
	movq	_OP_MOD_XYZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_STMPE_OP_MODE
	movq	%r15, %rdi
	movl	%r12d, %esi
	movl	%ebx, %edx
	movl	%eax, %ecx
	callq	_stmpe_set_bits
	testl	%eax, %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_12
## %bb.13:
	movl	%eax, %r14d
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_14
LBB0_12:
	xorl	%r14d, %r14d
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_STMPE_BLOCK_TOUCHSCREEN,4,2    ## @STMPE_BLOCK_TOUCHSCREEN
	.comm	_STMPE_BLOCK_ADC,4,2            ## @STMPE_BLOCK_ADC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not enable clock for ADC and TS\n"

	.comm	_STMPE_REG_TSC_CFG,4,2          ## @STMPE_REG_TSC_CFG
L_.str.1:                               ## @.str.1
	.asciz	"Could not config touch\n"

	.comm	_STMPE_REG_TSC_FRACTION_Z,4,2   ## @STMPE_REG_TSC_FRACTION_Z
	.comm	_STMPE_REG_TSC_I_DRIVE,4,2      ## @STMPE_REG_TSC_I_DRIVE
	.comm	_STMPE_REG_FIFO_TH,4,2          ## @STMPE_REG_FIFO_TH
L_.str.2:                               ## @.str.2
	.asciz	"Could not set FIFO\n"

	.comm	_STMPE_REG_TSC_CTRL,4,2         ## @STMPE_REG_TSC_CTRL
	.comm	_OP_MOD_XYZ,4,2                 ## @OP_MOD_XYZ
L_.str.3:                               ## @.str.3
	.asciz	"Could not set mode\n"

	.no_dead_strip	_stmpe_init_hw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stmpe_init_hw
_stmpe_init_hw:                         ; @stmpe_init_hw
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x0
Lloh0:
	adrp	x23, _STMPE_BLOCK_TOUCHSCREEN@GOTPAGE
Lloh1:
	ldr	x23, [x23, _STMPE_BLOCK_TOUCHSCREEN@GOTPAGEOFF]
	ldp	x19, x20, [x0, #24]
	ldr	w8, [x23]
Lloh2:
	adrp	x24, _STMPE_BLOCK_ADC@GOTPAGE
Lloh3:
	ldr	x24, [x24, _STMPE_BLOCK_ADC@GOTPAGEOFF]
	ldr	w9, [x24]
	orr	w1, w9, w8
	mov	x0, x20
	bl	_stmpe_enable
	cbz	w0, LBB0_3
; %bb.1:
	mov	x22, x0
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
LBB0_2:
	mov	x0, x19
	bl	_dev_err
	b	LBB0_5
LBB0_3:
	mov	x0, x20
	bl	_stmpe811_adc_common_init
	cbz	w0, LBB0_6
; %bb.4:
	mov	x22, x0
	ldr	w8, [x23]
	ldr	w9, [x24]
	orr	w1, w9, w8
	mov	x0, x20
	bl	_stmpe_disable
LBB0_5:
	mov	x0, x22
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_6:
	ldr	w0, [x21]
	bl	_STMPE_AVE_CTRL
	mov	x22, x0
	ldr	w0, [x21, #4]
	bl	_STMPE_DET_DELAY
	orr	w22, w0, w22
	ldr	w0, [x21, #8]
	bl	_STMPE_SETTLING
	orr	w22, w22, w0
	mov	w0, #255
	bl	_STMPE_AVE_CTRL
	mov	x23, x0
	mov	w0, #255
	bl	_STMPE_DET_DELAY
	orr	w23, w0, w23
	mov	w0, #255
	bl	_STMPE_SETTLING
	orr	w2, w23, w0
Lloh6:
	adrp	x8, _STMPE_REG_TSC_CFG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _STMPE_REG_TSC_CFG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x3, x22
	bl	_stmpe_set_bits
	cbnz	w0, LBB0_9
; %bb.7:
Lloh9:
	adrp	x8, _STMPE_REG_TSC_FRACTION_Z@GOTPAGE
Lloh10:
	ldr	x8, [x8, _STMPE_REG_TSC_FRACTION_Z@GOTPAGEOFF]
Lloh11:
	ldr	w22, [x8]
	mov	w0, #255
	bl	_STMPE_FRACTION_Z
	mov	x23, x0
	ldr	w0, [x21, #12]
	bl	_STMPE_FRACTION_Z
	mov	x3, x0
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_stmpe_set_bits
	cbnz	w0, LBB0_9
; %bb.8:
Lloh12:
	adrp	x8, _STMPE_REG_TSC_I_DRIVE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _STMPE_REG_TSC_I_DRIVE@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	mov	w0, #255
	bl	_STMPE_I_DRIVE
	mov	x23, x0
	ldr	w0, [x21, #16]
	bl	_STMPE_I_DRIVE
	mov	x3, x0
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_stmpe_set_bits
	cbz	w0, LBB0_10
LBB0_9:
	mov	x22, x0
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_10:
Lloh17:
	adrp	x8, _STMPE_REG_FIFO_TH@GOTPAGE
Lloh18:
	ldr	x8, [x8, _STMPE_REG_FIFO_TH@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_stmpe_reg_write
	cbz	w0, LBB0_12
; %bb.11:
	mov	x22, x0
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_2
LBB0_12:
Lloh22:
	adrp	x8, _STMPE_REG_TSC_CTRL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _STMPE_REG_TSC_CTRL@GOTPAGEOFF]
Lloh24:
	ldr	w21, [x8]
	mov	w0, #255
	bl	_STMPE_OP_MODE
	mov	x22, x0
Lloh25:
	adrp	x8, _OP_MOD_XYZ@GOTPAGE
Lloh26:
	ldr	x8, [x8, _OP_MOD_XYZ@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	bl	_STMPE_OP_MODE
	mov	x3, x0
	mov	x0, x20
	mov	x1, x21
	mov	x2, x22
	bl	_stmpe_set_bits
	mov	x22, x0
	cbz	w0, LBB0_5
; %bb.13:
Lloh28:
	adrp	x1, l_.str.3@PAGE
Lloh29:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_2
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_STMPE_BLOCK_TOUCHSCREEN,4,2    ; @STMPE_BLOCK_TOUCHSCREEN
	.comm	_STMPE_BLOCK_ADC,4,2            ; @STMPE_BLOCK_ADC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not enable clock for ADC and TS\n"

	.comm	_STMPE_REG_TSC_CFG,4,2          ; @STMPE_REG_TSC_CFG
l_.str.1:                               ; @.str.1
	.asciz	"Could not config touch\n"

	.comm	_STMPE_REG_TSC_FRACTION_Z,4,2   ; @STMPE_REG_TSC_FRACTION_Z
	.comm	_STMPE_REG_TSC_I_DRIVE,4,2      ; @STMPE_REG_TSC_I_DRIVE
	.comm	_STMPE_REG_FIFO_TH,4,2          ; @STMPE_REG_FIFO_TH
l_.str.2:                               ; @.str.2
	.asciz	"Could not set FIFO\n"

	.comm	_STMPE_REG_TSC_CTRL,4,2         ; @STMPE_REG_TSC_CTRL
	.comm	_OP_MOD_XYZ,4,2                 ; @OP_MOD_XYZ
l_.str.3:                               ; @.str.3
	.asciz	"Could not set mode\n"

	.no_dead_strip	_stmpe_init_hw
.subsections_via_symbols
